C# Class SportingSolutions.Udapi.Sdk.StreamController

The StreamController is responsible for managing the connection to the RabbitMQ streaming server. There is only ONE streaming connection, independently of how many resources/consumers are added. Each consumer has its own queue, but the connection is shared among all the consumers. If the connection goes down, all the consumers get disconnected. There is no automatic re-connection. A connection is (re)-established when the first consumer is added. Once a connection is established the StreamSubscriber object is set to read from the connection for any up coming messages. The StreamSubscriber then passed this object to the IDispatch object whose task it to dispatch the messages to the correct consumer.
Inheritance: IDisposable
Show file Open project: sportingsolutions/SS.Integration.UnifiedDataAPIClient.DotNet Class Usage Examples

Private Properties

Property Type Description
Connect void
StreamController System
StreamController System

Public Methods

Method Description
AddConsumer ( IConsumer consumer, int echoInterval, int echoMaxDelay ) : void
Dispose ( ) : void
RemoveConsumer ( IConsumer consumer ) : void
Shutdown ( ) : void

Protected Methods

Method Description
AddConsumerToQueue ( IConsumer consumer ) : void
CloseConnection ( ) : void
EstablishConnection ( ConnectionFactory factory ) : void
OnConnectionShutdown ( object sender, RabbitMQ.Client.ShutdownEventArgs sea ) : void
OnConnectionStatusChanged ( ConnectionState newState ) : void
RemoveConsumerFromQueue ( IConsumer consumer ) : void

Private Methods

Method Description
Connect ( IConsumer consumer ) : void
StreamController ( ) : System
StreamController ( IDispatcher dispatcher ) : System

Method Details

AddConsumer() public method

public AddConsumer ( IConsumer consumer, int echoInterval, int echoMaxDelay ) : void
consumer IConsumer
echoInterval int
echoMaxDelay int
return void

AddConsumerToQueue() protected method

protected AddConsumerToQueue ( IConsumer consumer ) : void
consumer IConsumer
return void

CloseConnection() protected method

protected CloseConnection ( ) : void
return void

Dispose() public method

public Dispose ( ) : void
return void

EstablishConnection() protected method

protected EstablishConnection ( ConnectionFactory factory ) : void
factory RabbitMQ.Client.ConnectionFactory
return void

OnConnectionShutdown() protected method

protected OnConnectionShutdown ( object sender, RabbitMQ.Client.ShutdownEventArgs sea ) : void
sender object
sea RabbitMQ.Client.ShutdownEventArgs
return void

OnConnectionStatusChanged() protected method

protected OnConnectionStatusChanged ( ConnectionState newState ) : void
newState ConnectionState
return void

RemoveConsumer() public method

public RemoveConsumer ( IConsumer consumer ) : void
consumer IConsumer
return void

RemoveConsumerFromQueue() protected method

protected RemoveConsumerFromQueue ( IConsumer consumer ) : void
consumer IConsumer
return void

Shutdown() public method

public Shutdown ( ) : void
return void