C# Class CrossroadsIO.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: Device
Show file Open project: jgoz/crossroads-net

Public Methods

Method Description
QueueDevice ( Context context )

Initializes a new instance of the QueueDevice class that will run in a self-managed thread.

QueueDevice ( Context context, DeviceMode mode )

Initializes a new instance of the QueueDevice class.

QueueDevice ( Context context, string frontendBindAddr, string backendBindAddr )

Initializes a new instance of the QueueDevice class that will run in a self-managed thread.

QueueDevice ( Context context, string frontendBindAddr, string backendBindAddr, DeviceMode mode )

Initializes a new instance of the QueueDevice class.

Protected Methods

Method Description
BackendHandler ( SocketEventArgs args ) : void

Forwards replies from the backend socket to the frontend socket.

FrontendHandler ( SocketEventArgs args ) : void

Forwards requests from the frontend socket to the backend socket.

Method Details

BackendHandler() protected method

Forwards replies from the backend socket to the frontend socket.
protected BackendHandler ( SocketEventArgs args ) : void
args SocketEventArgs A object containing the poll event args.
return void

FrontendHandler() protected method

Forwards requests from the frontend socket to the backend socket.
protected FrontendHandler ( SocketEventArgs args ) : void
args SocketEventArgs A object containing the poll event args.
return void

QueueDevice() public method

Initializes a new instance of the QueueDevice class that will run in a self-managed thread.
public QueueDevice ( Context context )
context Context The to use when creating the sockets.

QueueDevice() public method

Initializes a new instance of the QueueDevice class.
public QueueDevice ( Context context, DeviceMode mode )
context Context The to use when creating the sockets.
mode DeviceMode The for the current device.

QueueDevice() public method

Initializes a new instance of the QueueDevice class that will run in a self-managed thread.
public QueueDevice ( Context context, string frontendBindAddr, string backendBindAddr )
context Context The to use when creating the sockets.
frontendBindAddr string The endpoint used to bind the frontend socket.
backendBindAddr string The endpoint used to bind the backend socket.

QueueDevice() public method

Initializes a new instance of the QueueDevice class.
public QueueDevice ( Context context, string frontendBindAddr, string backendBindAddr, DeviceMode mode )
context Context The to use when creating the sockets.
frontendBindAddr string The endpoint used to bind the frontend socket.
backendBindAddr string The endpoint used to bind the backend socket.
mode DeviceMode The for the current device.