C# Class paramore.brighter.serviceactivator.Dispatcher

Class Dispatcher. The 'core' Service Activator class, the Dispatcher controls and co-ordinates the creation of readers from channels, and dispatching the commands and events translated from those messages to handlers. It controls the lifetime of the application through Receive and End and allows the stop and start of individual connections through Open and Shut
Inheritance: IDispatcher
ファイルを表示 Open project: iancooper/Paramore Class Usage Examples

Public Methods

Method Description
Dispatcher ( IAmACommandProcessor commandProcessor, IAmAMessageMapperRegistry messageMapperRegistry, IEnumerable connections ) : System

Initializes a new instance of the Dispatcher class.

End ( ) : System.Threading.Tasks.Task

Stop listening to messages

Open ( Connection connection ) : void

Opens the specified connection.

Open ( string connectionName ) : void

Opens the specified connection by name

Receive ( ) : void

Begins listening for messages on channels, and dispatching them to request handlers.

Shut ( Connection connection ) : void

Shuts the specified connection.

Shut ( string connectionName ) : void

Shuts the specified connection by name

Private Methods

Method Description
AddConnectionToConnections ( Connection connection ) : void
CreateConsumers ( IEnumerable connections ) : IEnumerable
Start ( ) : void

Method Details

Dispatcher() public method

Initializes a new instance of the Dispatcher class.
public Dispatcher ( IAmACommandProcessor commandProcessor, IAmAMessageMapperRegistry messageMapperRegistry, IEnumerable connections ) : System
commandProcessor IAmACommandProcessor The command processor.
messageMapperRegistry IAmAMessageMapperRegistry The message mapper registry.
connections IEnumerable The connections.
return System

End() public method

Stop listening to messages
public End ( ) : System.Threading.Tasks.Task
return System.Threading.Tasks.Task

Open() public method

Opens the specified connection.
public Open ( Connection connection ) : void
connection Connection The connection.
return void

Open() public method

Opens the specified connection by name
public Open ( string connectionName ) : void
connectionName string The name of the connection
return void

Receive() public method

Begins listening for messages on channels, and dispatching them to request handlers.
public Receive ( ) : void
return void

Shut() public method

Shuts the specified connection.
public Shut ( Connection connection ) : void
connection Connection The connection.
return void

Shut() public method

Shuts the specified connection by name
public Shut ( string connectionName ) : void
connectionName string The name of the connection
return void