Photon Server API
Public Member Functions | Protected Member Functions | Properties | List of all members
ExitGames.Messaging.Channels.LockedMessageQueue< T > Class Template Reference

The LockedMessageQueue<T> is a thread safe extension of the MessageQueue<T>. More...

Inheritance diagram for ExitGames.Messaging.Channels.LockedMessageQueue< T >:
ExitGames.Messaging.Channels.MessageQueue< T > ExitGames.Messaging.Channels.IMessageQueue< T >

Public Member Functions

 LockedMessageQueue (IFiber executor)
 Initializes a new instance of the LockedMessageQueue<T> class. More...
 
 LockedMessageQueue ()
 Initializes a new instance of the LockedMessageQueue<T> class. More...
 
override T Dequeue ()
 Dequeues the next message. More...
 
override List< T > Dequeue (int maxCount)
 Dequeues up to the given amount of messages. More...
 
override List< T > Dequeue (int maxCount, Func< T, bool > skip)
 Dequeues up to the given amount of messages. More...
 
override List< T > DequeueAll ()
 Dequeues all messages. More...
 
override List< T > DequeueAll (Func< T, bool > skip)
 Dequeues all messages. More...
 
override void Enqueue (T message)
 Enqueues a message. More...
 
void Enqueue (List< T > messages)
 Enqueues a list of messages. More...
 
override bool IsSubscribed (string topic)
 Checks if queue is subscribed to a channel with a certain topic. More...
 
override bool Subscribe (string topic, Concurrency.Channels.IChannel< T > channel)
 Subscribes to a Concurrency.Channels.IChannel<T> with a topic. More...
 
override bool Unsubscribe (string topic)
 Unsubscribes from a topic channel. More...
 
- Public Member Functions inherited from ExitGames.Messaging.Channels.MessageQueue< T >
 MessageQueue (IFiber executor)
 Initializes a new instance of the MessageQueue<T> class. More...
 
 MessageQueue ()
 Initializes a new instance of the MessageQueue<T> class. More...
 
void Dispose ()
 Disposes the managed and unmanaged resources. More...
 

Protected Member Functions

override void Dispose (bool disposing)
 Disposes the managed and unmanaged resources. More...
 

Properties

override int Count [get]
 Gets the number of queued messages. More...
 
- Properties inherited from ExitGames.Messaging.Channels.MessageQueue< T >
virtual int Count [get]
 Gets the number of queued message. More...
 
IFiber Executor [get]
 Gets the executing IFiber. More...
 
Queue< T > Messages [get]
 Gets the messages. More...
 
SubscriptionContainer Subscriptions [get]
 Gets the suscriptions. More...
 
- Properties inherited from ExitGames.Messaging.Channels.IMessageQueue< T >
int Count [get]
 Gets the number of queued message. More...
 

Detailed Description

The LockedMessageQueue<T> is a thread safe extension of the MessageQueue<T>.

Template Parameters
TThe message type.

Constructor & Destructor Documentation

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

Parameters
executorThe fiber.

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

Member Function Documentation

override T ExitGames.Messaging.Channels.LockedMessageQueue< T >.Dequeue ( )
inlinevirtual

Dequeues the next message.

Returns
A message.

Reimplemented from ExitGames.Messaging.Channels.MessageQueue< T >.

override List<T> ExitGames.Messaging.Channels.LockedMessageQueue< T >.Dequeue ( int  maxCount)
inlinevirtual

Dequeues up to the given amount of messages.

Parameters
maxCountThe max number of messages to dequeue.
Returns
A list of messages.

Reimplemented from ExitGames.Messaging.Channels.MessageQueue< T >.

override List<T> ExitGames.Messaging.Channels.LockedMessageQueue< T >.Dequeue ( int  maxCount,
Func< T, bool >  skip 
)
inlinevirtual

Dequeues up to the given amount of messages.

Parameters
maxCountThe max number of messages to dequeue.
skipA message filter.
Returns
A list of messages.

Reimplemented from ExitGames.Messaging.Channels.MessageQueue< T >.

override List<T> ExitGames.Messaging.Channels.LockedMessageQueue< T >.DequeueAll ( )
inlinevirtual

Dequeues all messages.

Returns
A list of messages.

Reimplemented from ExitGames.Messaging.Channels.MessageQueue< T >.

override List<T> ExitGames.Messaging.Channels.LockedMessageQueue< T >.DequeueAll ( Func< T, bool >  skip)
inlinevirtual

Dequeues all messages.

Parameters
skipA message filter.
Returns
A list of messages.

Reimplemented from ExitGames.Messaging.Channels.MessageQueue< T >.

override void ExitGames.Messaging.Channels.LockedMessageQueue< T >.Dispose ( bool  disposing)
inlineprotectedvirtual

Disposes the managed and unmanaged resources.

Parameters
disposingTrue if called from Dispose.

Reimplemented from ExitGames.Messaging.Channels.MessageQueue< T >.

override void ExitGames.Messaging.Channels.LockedMessageQueue< T >.Enqueue ( message)
inlinevirtual

Enqueues a message.

Parameters
messageA message.

Reimplemented from ExitGames.Messaging.Channels.MessageQueue< T >.

void ExitGames.Messaging.Channels.LockedMessageQueue< T >.Enqueue ( List< T >  messages)
inline

Enqueues a list of messages.

Parameters
messagesThe messages.
override bool ExitGames.Messaging.Channels.LockedMessageQueue< T >.IsSubscribed ( string  topic)
inlinevirtual

Checks if queue is subscribed to a channel with a certain topic.

Parameters
topicThe topic.
Returns
True if subscribed.

Reimplemented from ExitGames.Messaging.Channels.MessageQueue< T >.

override bool ExitGames.Messaging.Channels.LockedMessageQueue< T >.Subscribe ( string  topic,
Concurrency.Channels.IChannel< T >  channel 
)
inlinevirtual

Subscribes to a Concurrency.Channels.IChannel<T> with a topic.

Parameters
topicThe channel topic.
channelThe channel.
Returns
True if resubscribed, false if subscribed first time.

Reimplemented from ExitGames.Messaging.Channels.MessageQueue< T >.

override bool ExitGames.Messaging.Channels.LockedMessageQueue< T >.Unsubscribe ( string  topic)
inlinevirtual

Unsubscribes from a topic channel.

Parameters
topicThe topic.
Returns
True if unsubscribed.

Reimplemented from ExitGames.Messaging.Channels.MessageQueue< T >.

Property Documentation

Gets the number of queued messages.