C# Class NetMQ.Devices.QueueDevice

A shared queue that collects requests from a set of clients and distributes these fairly among a set of services.
Requests are fair-queued from frontend connections and load-balanced between backend connections. Replies automatically return to the client that made the original request. This device is part of the request-reply pattern. The frontend speaks to clients and the backend speaks to services.
Inheritance: DeviceBase
ファイルを表示 Open project: NetMQ/NetMQ3-x Class Usage Examples

Public Methods

Method Description
QueueDevice ( INetMQPoller poller, string frontendBindAddress, string backendBindAddress, DeviceMode mode = DeviceMode.Threaded ) : System

Initializes a new instance of the QueueDevice class.

QueueDevice ( string frontendBindAddress, string backendBindAddress, DeviceMode mode = DeviceMode.Threaded ) : System

Initializes a new instance of the QueueDevice class.

Protected Methods

Method Description
BackendHandler ( object sender, NetMQSocketEventArgs args ) : void

This override of BackendHandler receives data from the socket contained within args, and Sends it to FrontendSocket.

FrontendHandler ( object sender, NetMQSocketEventArgs args ) : void

This override of FrontendHandler receives data from the socket contained within args, and Sends it to BackendSocket.

Private Methods

Method Description
ForwardTo ( NetMQSocketEventArgs args, IOutgoingSocket toSocket ) : void
QueueDevice ( NetMQContext context, INetMQPoller poller, string frontendBindAddress, string backendBindAddress, DeviceMode mode = DeviceMode.Threaded ) : System
QueueDevice ( NetMQContext context, string frontendBindAddress, string backendBindAddress, DeviceMode mode = DeviceMode.Threaded ) : System

Method Details

BackendHandler() protected method

This override of BackendHandler receives data from the socket contained within args, and Sends it to FrontendSocket.
protected BackendHandler ( object sender, NetMQSocketEventArgs args ) : void
sender object unused
args NetMQSocketEventArgs a NetMQSocketEventArgs that contains a Socket for receiving data from
return void

FrontendHandler() protected method

This override of FrontendHandler receives data from the socket contained within args, and Sends it to BackendSocket.
protected FrontendHandler ( object sender, NetMQSocketEventArgs args ) : void
sender object unused
args NetMQSocketEventArgs a NetMQSocketEventArgs that contains a NetMQSocket for receiving data from
return void

QueueDevice() public method

Initializes a new instance of the QueueDevice class.
public QueueDevice ( INetMQPoller poller, string frontendBindAddress, string backendBindAddress, DeviceMode mode = DeviceMode.Threaded ) : System
poller INetMQPoller The to use.
frontendBindAddress string The endpoint used to bind the frontend socket.
backendBindAddress string The endpoint used to bind the backend socket.
mode DeviceMode The for the device.
return System

QueueDevice() public method

Initializes a new instance of the QueueDevice class.
public QueueDevice ( string frontendBindAddress, string backendBindAddress, DeviceMode mode = DeviceMode.Threaded ) : System
frontendBindAddress string The endpoint used to bind the frontend socket.
backendBindAddress string The endpoint used to bind the backend socket.
mode DeviceMode The for the device.
return System