IOT Dash
|
Public Member Functions | |
virtual void | Subscribe (TChannelKey msgChannel, ITarget< TChannelKey, TMsg > target, out ISubscription subscription) |
virtual void | Subscribe (TChannelKey msgChannel, ITarget< TChannelKey, TMsg > target, SubscriptionGuard guard) |
abstract int | TargetCountOnChannel (TChannelKey key) |
abstract IEnumerable< ITarget< TChannelKey, TMsg > > | GetChannelCopy (TChannelKey key) |
abstract void | Unsubscribe (ISubscription< TChannelKey, TMsg > subscription) |
abstract Task | Send (TChannelKey msgChannel, object sender, TMsg msg) |
Protected Member Functions | |
abstract void | SubscribeInternal (TChannelKey msgChannel, ITarget< TChannelKey, TMsg > target) |
Properties | |
abstract int | TargetCount [get] |
abstract IEnumerable< TChannelKey > | Keys [get] |
This class implements part the mediator design pattern. Takes responsibility for managing subscriptions of channels. The implementation of the actual message delegation is left to the child class of this.
TChannelKey | Type of the channel identifiers. |
TMsg | Type of the messages which are delegated by this mediator. |
TChannelKey | : | notnull | |
TMsg | : | notnull |
|
pure virtual |
A list of all subscribers of channel key .
key | The key identifying that channel. |
Implemented in IotDash.Domain.Mediator.SimpleMediator< TChannelKey, TMsg >.
|
pure virtual |
Send a message to a channel.
msgChannel | The channel to send over. |
sender | The message sender (optional). |
msg | Message to send. |
|
inlinevirtual |
Register a new message target to receive messages from a particular channel. Creates the ISubscription and calls SubscribeInternal(TChannelKey, ITarget<TChannelKey, TMsg>).
msgChannel | The channel identifier. |
target | The message target. |
subscription | Subscription object. Dispose it to cancel the subscription. |
|
inlinevirtual |
Register a new message target to receive messages from a particular channel. Registers the ISubscription under the given guard and calls SubscribeInternal(TChannelKey, ITarget<TChannelKey, TMsg>).
msgChannel | The channel identifier. |
target | The message target. |
guard | Subscription guard to manage the created subscription. |
|
protectedpure virtual |
Internal, ISubscription unaware method prepared for inheritor implementation. It is here to prevent the inheritor from forgetting to properly create the ISubscription.
msgChannel | |
target |
Implemented in IotDash.Domain.Mediator.SimpleMediator< TChannelKey, TMsg >.
|
pure virtual |
Number of ITarget<TChannelKey, TMsg> subscribed to channel key .
key | The channel to filter by. |
Implemented in IotDash.Domain.Mediator.SimpleMediator< TChannelKey, TMsg >.