Photon Server API Documentation v5.0RC1

Public Member Functions | List of all members
ExitGames.Concurrency.Channels.ISubscriber< T > Interface Template Reference

Channel subscription methods. More...

Inheritance diagram for ExitGames.Concurrency.Channels.ISubscriber< T >:
ExitGames.Concurrency.Channels.IChannel< T > ExitGames.Concurrency.Channels.Channel< T >

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...
 

Detailed Description

Channel subscription methods.

Template Parameters
T

Member Function Documentation

◆ ClearSubscribers()

void ExitGames.Concurrency.Channels.ISubscriber< T >.ClearSubscribers ( )

Removes all subscribers.

Implemented in ExitGames.Concurrency.Channels.Channel< T >.

◆ Subscribe()

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 >.

◆ SubscribeToBatch()

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.

Parameters
fiberThe target context to execute the action
receive
intervalInMsTime in Ms to batch actions. If 0 events will be delivered as fast as consumer can process
Returns

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 >.

◆ SubscribeToKeyedBatch< TOutput >()

IDisposable ExitGames.Concurrency.Channels.ISubscriber< T >.SubscribeToKeyedBatch< TOutput > ( IFiber  fiber,
Converter< T, TOutput >  keyResolver,
Action< IDictionary< TOutput, T >>  receive,
int  intervalInMs 
)

◆ SubscribeToLast()

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.

Parameters
fiber
receive
intervalInMs
Returns

Implemented in ExitGames.Concurrency.Channels.Channel< T >.