Photon Server API Documentation v5.0RC1

Public Member Functions | Properties | List of all members
ExitGames.Concurrency.Channels.Channel< T > Class Template Reference

Default Channel Implementation. Methods are thread safe. /summary> typeparam name="T"> More...

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

Public Member Functions

IDisposable Subscribe (IFiber fiber, Action< T > receive)
 ISubscriber<T>.Subscribe(IFiber,Action<T>) More...
 
IDisposable SubscribeToBatch (IFiber fiber, Action< IList< T >> receive, int intervalInMs)
 ISubscriber<T>.SubscribeToBatch(IFiber,Action<IList<T>>,int) More...
 
IDisposable SubscribeToKeyedBatch< TOutput > (IFiber fiber, Converter< T, TOutput > keyResolver, Action< IDictionary< TOutput, T >> receive, int intervalInMs)
 ISubscriber<T>.SubscribeToKeyedBatch<K>(IFiber,Converter<T,K>,Action<IDictionary<K,T>>,int) More...
 
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...
 
IDisposable SubscribeOnProducerThreads (IProducerThreadSubscriber< T > subscriber)
 Subscribes to actions on producer threads. Subscriber could be called from multiple threads. More...
 
void ClearSubscribers ()
 Remove all subscribers. More...
 
- Public Member Functions inherited from ExitGames.Concurrency.Channels.IPublisher< T >
bool Publish (T msg)
 Publish a message to all subscribers. Returns true if any subscribers are registered. More...
 

Properties

bool HasSubscriptions [get]
 Gets a value indicating if this instance has subscriptions. More...
 
int? NumSubscribers [get]
 

Detailed Description

Default Channel Implementation. Methods are thread safe. /summary> typeparam name="T">

Member Function Documentation

◆ ClearSubscribers()

void ExitGames.Concurrency.Channels.Channel< T >.ClearSubscribers ( )
inline

Remove all subscribers.

Implements ExitGames.Concurrency.Channels.ISubscriber< T >.

◆ Subscribe()

IDisposable ExitGames.Concurrency.Channels.Channel< T >.Subscribe ( IFiber  fiber,
Action< T >  receive 
)
inline

◆ SubscribeOnProducerThreads()

IDisposable ExitGames.Concurrency.Channels.Channel< T >.SubscribeOnProducerThreads ( IProducerThreadSubscriber< T >  subscriber)
inline

Subscribes to actions on producer threads. Subscriber could be called from multiple threads.

Parameters
subscriber
Returns

Implements ExitGames.Concurrency.Channels.IChannel< T >.

◆ SubscribeToBatch()

IDisposable ExitGames.Concurrency.Channels.Channel< T >.SubscribeToBatch ( IFiber  fiber,
Action< IList< T >>  receive,
int  intervalInMs 
)
inline

◆ SubscribeToKeyedBatch< TOutput >()

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

ISubscriber<T>.SubscribeToKeyedBatch<K>(IFiber,Converter<T,K>,Action<IDictionary<K,T>>,int)

Template Parameters
TOutput
Parameters
fiber
keyResolver
receive
intervalInMs
Returns

Implements ExitGames.Concurrency.Channels.ISubscriber< T >.

◆ SubscribeToLast()

IDisposable ExitGames.Concurrency.Channels.Channel< T >.SubscribeToLast ( IFiber  fiber,
Action< T >  receive,
int  intervalInMs 
)
inline

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

Implements ExitGames.Concurrency.Channels.ISubscriber< T >.

Property Documentation

◆ HasSubscriptions

bool ExitGames.Concurrency.Channels.Channel< T >.HasSubscriptions
get

Gets a value indicating if this instance has subscriptions.

◆ NumSubscribers

int? ExitGames.Concurrency.Channels.Channel< T >.NumSubscribers
get