Channel subscription methods. More...
Public Member Functions | |
IDisposable | Subscribe (IFiber fiber, Action< T > receive) |
Subscribe to messages on this channel. The provided action will be invoked via a Action on the provided executor. /summary> param name="fiber">the target executor to receive the messageparam name="receive">returns>Unsubscriber object More... | |
IDisposable | SubscribeToBatch (IFiber fiber, Action< IList< T >> receive, int intervalInMs) |
Subscribes to actions on the channel in batch form. The events will be batched if the consumer is unable to process the events faster than the arrival rate. More... | |
IDisposable | SubscribeToKeyedBatch< TOutput > (IFiber fiber, Converter< T, TOutput > keyResolver, Action< IDictionary< TOutput, T >> receive, int intervalInMs) |
IDisposable | SubscribeToLast (IFiber fiber, Action< T > receive, int intervalInMs) |
Subscription that delivers the latest message to the consuming thread. If a newer message arrives before the consuming thread has a chance to process the message, the pending message is replaced by the newer message. The old message is discarded. More... | |
void | ClearSubscribers () |
Removes all subscribers. More... | |
Channel subscription methods.
T |
void ExitGames.Concurrency.Channels.ISubscriber< T >.ClearSubscribers | ( | ) |
Removes all subscribers.
Implemented in ExitGames.Concurrency.Channels.Channel< T >.
IDisposable ExitGames.Concurrency.Channels.ISubscriber< T >.Subscribe | ( | IFiber | fiber, |
Action< T > | receive | ||
) |
Subscribe to messages on this channel. The provided action will be invoked via a Action on the provided executor. /summary> param name="fiber">the target executor to receive the messageparam name="receive">returns>Unsubscriber object
Implemented in ExitGames.Concurrency.Channels.Channel< T >.
IDisposable ExitGames.Concurrency.Channels.ISubscriber< T >.SubscribeToBatch | ( | IFiber | fiber, |
Action< IList< T >> | receive, | ||
int | intervalInMs | ||
) |
Subscribes to actions on the channel in batch form. The events will be batched if the consumer is unable to process the events faster than the arrival rate.
fiber | The target context to execute the action |
receive | |
intervalInMs | Time in Ms to batch actions. If 0 events will be delivered as fast as consumer can process |
summary> Batches actions based upon keyed values allowing for duplicates to be dropped. /summary> param name="fiber">
param name="keyResolver">
param name="receive">
param name="intervalInMs">
typeparam name="TOutput">
returns>
Implemented in ExitGames.Concurrency.Channels.Channel< T >.
IDisposable ExitGames.Concurrency.Channels.ISubscriber< T >.SubscribeToKeyedBatch< TOutput > | ( | IFiber | fiber, |
Converter< T, TOutput > | keyResolver, | ||
Action< IDictionary< TOutput, T >> | receive, | ||
int | intervalInMs | ||
) |
Implemented in ExitGames.Concurrency.Channels.Channel< T >.
IDisposable ExitGames.Concurrency.Channels.ISubscriber< T >.SubscribeToLast | ( | IFiber | fiber, |
Action< T > | receive, | ||
int | intervalInMs | ||
) |
Subscription that delivers the latest message to the consuming thread. If a newer message arrives before the consuming thread has a chance to process the message, the pending message is replaced by the newer message. The old message is discarded.
fiber | |
receive | |
intervalInMs |
Implemented in ExitGames.Concurrency.Channels.Channel< T >.