Photon Server API
Classes | Public Member Functions | Protected Member Functions | List of all members
Photon.SocketServer.Concurrency.MessageChannel< T > Class Template Reference

Subclass of ExitGames.Concurrency.Channels.Channel<T>. Uses an ExitGames.Diagnostics.Counter.ICounter to track the amount of published messages. More...

Inheritance diagram for Photon.SocketServer.Concurrency.MessageChannel< T >:
" alt="ExitGames.Concurrency.Channels.Channel< T >" shape="rect" coords="177,112,521,136"/> ExitGames.Concurrency.Channels.IChannel< T > ExitGames.Concurrency.Channels.ISubscriber< T > ExitGames.Concurrency.Channels.IPublisher< T >

Public Member Functions

 MessageChannel (ICounter publishCounter)
 Initializes a new instance of the MessageChannel<T> class. More...
 
void Dispose ()
 Calls Dispose(bool). More...
 
- Public Member Functions inherited from ExitGames.Concurrency.Channels.Channel< T >
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...
 

Protected Member Functions

virtual void Dispose (bool disposing)
 Disposes the counter and clears all subscribers. More...
 

Additional Inherited Members

- Properties inherited from ExitGames.Concurrency.Channels.Channel< T >
bool HasSubscriptions [get]
 
int NumSubscribers [get]
 

Detailed Description

Subclass of ExitGames.Concurrency.Channels.Channel<T>. Uses an ExitGames.Diagnostics.Counter.ICounter to track the amount of published messages.

Template Parameters
TThe type of message published in this channel.

Constructor & Destructor Documentation

Initializes a new instance of the MessageChannel<T> class.

Parameters
publishCounterThe counter to track the amount of published messages.

Member Function Documentation

void Photon.SocketServer.Concurrency.MessageChannel< T >.Dispose ( )
inline

Calls Dispose(bool).

virtual void Photon.SocketServer.Concurrency.MessageChannel< T >.Dispose ( bool  disposing)
inlineprotectedvirtual

Disposes the counter and clears all subscribers.

Parameters
disposingIndicates wheter called from Dispose() or from the destructor.