MessageQueue
Overview
The MessageQueue class implements the IMessageQueue interface and is used as base a class for all Remoting SDK implementations of a serialized message queues. Message queues are used by MessageQueueManager infrastructure to manage serialized server-sent events data.
Location
- Reference: RemObjects.SDK.Server.dll
- Namespace: RemObjects.SDK.Server
constructor protected
Create a new instance of the MessageQueue class.
constructor(clientId: Guid)
MessageQueue(Guid clientId)
Sub New(clientId As Guid)
Parameters:
- clientId: Client Id
ClientId
Gets Id of the client that is assotiated with the current message queue.
property ClientId: Guid read;
Guid ClientId { get; }
ReadOnly Property ClientId() As Guid
Count
Gets the count of messages currently stored in the queue.
property Count: Int32 read;
Int32 Count { get; }
ReadOnly Property Count() As Int32
Lock
Prevents the current queue instance from being accessed from another threads.
To prevent race conditions in a multithread environment, the code accessing message queues should always be protected by the Lock and Unlock methods pair.
method Lock
void Lock()
Sub Lock()
PeekMessage
Returns the first message in the queue, or null if the queue is empty. The message itself is not removed from the queue.
method PeekMessage: Stream
Stream PeekMessage()
Function PeekMessage() As Stream
PopMessage
Returns the first message in the queue. The message is removed from the queue.
method PopMessage: Stream
Stream PopMessage()
Function PopMessage() As Stream
QueueMessage
method QueueMessage(message: Stream)
void QueueMessage(Stream message)
Sub QueueMessage(message As Stream)
Parameters:
- message:
Unlock
Unblocks the current queue instance and allows it to be accessed from another threads.
To prevent race conditions in a multithread environment, the code accessing message queues should always be protected by the Lock and Unlock methods pair.
method Unlock
void Unlock()
Sub Unlock()
ClientId
Gets Id of the client that is assotiated with the current message queue.
property ClientId: Guid read;
Guid ClientId { get; }
ReadOnly Property ClientId() As Guid
Count
Gets the count of messages currently stored in the queue.
property Count: Int32 read;
Int32 Count { get; }
ReadOnly Property Count() As Int32
constructor protected
Create a new instance of the MessageQueue class.
constructor(clientId: Guid)
MessageQueue(Guid clientId)
Sub New(clientId As Guid)
Parameters:
- clientId: Client Id
Lock
Prevents the current queue instance from being accessed from another threads.
To prevent race conditions in a multithread environment, the code accessing message queues should always be protected by the Lock and Unlock methods pair.
method Lock
void Lock()
Sub Lock()
PeekMessage
Returns the first message in the queue, or null if the queue is empty. The message itself is not removed from the queue.
method PeekMessage: Stream
Stream PeekMessage()
Function PeekMessage() As Stream
PopMessage
Returns the first message in the queue. The message is removed from the queue.
method PopMessage: Stream
Stream PopMessage()
Function PopMessage() As Stream
QueueMessage
method QueueMessage(message: Stream)
void QueueMessage(Stream message)
Sub QueueMessage(message As Stream)
Parameters:
- message:
Unlock
Unblocks the current queue instance and allows it to be accessed from another threads.
To prevent race conditions in a multithread environment, the code accessing message queues should always be protected by the Lock and Unlock methods pair.
method Unlock
void Unlock()
Sub Unlock()