Photon Server API
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 > ExitGames.Messaging.Channels.Channel< T > Photon.SocketServer.Concurrency.MessageChannel< 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< K > (IFiber fiber, Converter< T, K > keyResolver, Action< IDictionary< K, 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...
 
bool Publish (T msg)
 IPublisher<T>.Publish(T) More...
 
void ClearSubscribers ()
 Remove all subscribers. More...
 

Properties

bool HasSubscriptions [get]
 
int NumSubscribers [get]
 

Detailed Description

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

Member Function Documentation

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

Remove all subscribers.

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

bool ExitGames.Concurrency.Channels.Channel< T >.Publish ( msg)
inline

IPublisher<T>.Publish(T)

Parameters
msg
Returns

summary> Number of subscribers /summary>

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

IDisposable ExitGames.Concurrency.Channels.Channel< T >.Subscribe ( IFiber  fiber,
Action< T >  receive 
)
inline
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 >.

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

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

Template Parameters
K
Parameters
fiber
keyResolver
receive
intervalInMs
Returns

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

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

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