Photon Server API
Public Member Functions | Properties | List of all members
ExitGames.Threading.BlockingQueue< T > Class Template Reference

This class is a Queue<T> wrapper that waits at Dequeue() until an item becomes available. More...

Public Member Functions

 BlockingQueue (int maxSize, int lockTimeout)
 Initializes a new instance of the BlockingQueue<T> class. More...
 
Dequeue ()
 Dequeues the next item. This methods waits until an item becomes available or until the default timeout has expired. More...
 
Dequeue (TimeSpan timeout)
 Dequeues the next item. This methods waits until an item becomes available or until the timeout has expired. More...
 
Dequeue (int waitTime)
 Dequeues the next item. This methods waits until an item becomes available or until the timeout has expired. More...
 
void Enqueue (T item)
 Enqueues an item. The default timeout is used to detect dead locks. More...
 
void Enqueue (T item, TimeSpan timeout)
 Enqueues an item. The timeout is used to detect dead locks. More...
 
void Enqueue (T value, int timeOut)
 Enqueues an item. The timeout is used to detect dead locks. More...
 

Properties

int MaxSize [get]
 Gets the max queue length. More...
 

Detailed Description

This class is a Queue<T> wrapper that waits at Dequeue() until an item becomes available.

Template Parameters
TType of object in queue.

Constructor & Destructor Documentation

ExitGames.Threading.BlockingQueue< T >.BlockingQueue ( int  maxSize,
int  lockTimeout 
)
inline

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

Parameters
maxSizeThe max queue length.
lockTimeoutThe max time in milliseconds to wait for a new item.

Member Function Documentation

T ExitGames.Threading.BlockingQueue< T >.Dequeue ( )
inline

Dequeues the next item. This methods waits until an item becomes available or until the default timeout has expired.

Returns
The next item in queue.
Exceptions
TimeoutExceptionNo item available within given time.
T ExitGames.Threading.BlockingQueue< T >.Dequeue ( TimeSpan  timeout)
inline

Dequeues the next item. This methods waits until an item becomes available or until the timeout has expired.

Parameters
timeoutThe max time to wait.
Returns
The next item in queue.
Exceptions
TimeoutExceptionNo item available within given time.
T ExitGames.Threading.BlockingQueue< T >.Dequeue ( int  waitTime)
inline

Dequeues the next item. This methods waits until an item becomes available or until the timeout has expired.

Parameters
waitTimeThe max wait time in milliseconds.
Returns
The next item in queue.
Exceptions
TimeoutExceptionNo item available within given time.
void ExitGames.Threading.BlockingQueue< T >.Enqueue ( item)
inline

Enqueues an item. The default timeout is used to detect dead locks.

Parameters
itemThe item.
Exceptions
TimeoutExceptionThe item could not be enqueued within the given time.
void ExitGames.Threading.BlockingQueue< T >.Enqueue ( item,
TimeSpan  timeout 
)
inline

Enqueues an item. The timeout is used to detect dead locks.

Parameters
itemThe item.
timeoutThe timeout.
Exceptions
TimeoutExceptionThe item could not be enqueued within the given time.
void ExitGames.Threading.BlockingQueue< T >.Enqueue ( value,
int  timeOut 
)
inline

Enqueues an item. The timeout is used to detect dead locks.

Parameters
valueThe value.
timeOutThe time out.
Exceptions
TimeoutExceptionThe item could not be enqueued within the given time.

Property Documentation

int ExitGames.Threading.BlockingQueue< T >.MaxSize
get

Gets the max queue length.