MemoryMessageQueue

Overview

The MemoryMessageQueue class represents a queue of serialized messages stored in memory. This class is used internally in the Remoting SDK whenever the MemoryMessageQueueManager is used as the message queue manager.

Location

 

constructor

Create a new instance of the MemoryMessageQueue class.

 

constructor(clientId: Guid)

 

MemoryMessageQueue(Guid clientId)

 

Sub New (clientId As Guid)

Parameters:

  • clientId: Client Id

ClientId    (declared in MessageQueue)

Gets Id of the client that is assotiated with the current message queue.

 

property ClientId: Guid read;

 

Guid ClientId { get; }

 

Property ReadOnly ClientId As Guid

Count

Gets the count of messages currently stored in the queue.

 

property Count: Int32 read;

 

Int32 Count { get; }

 

Property ReadOnly 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 MessageQueue and MessageQueue 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

Stores the provided serialized event message in the queue.

 

method QueueMessage(message: Stream)

 

void QueueMessage(Stream message)

 

Sub QueueMessage(message As Stream)

Parameters:

  • message: Message instance containing serialized event data

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 MessageQueue and MessageQueue methods pair.

 

method Unlock

 

void Unlock()

 

Sub Unlock

 

ClientId    (declared in MessageQueue)

Gets Id of the client that is assotiated with the current message queue.

 

property ClientId: Guid read;

 

Guid ClientId { get; }

 

Property ReadOnly ClientId As Guid

Count

Gets the count of messages currently stored in the queue.

 

property Count: Int32 read;

 

Int32 Count { get; }

 

Property ReadOnly Count As Int32

 

constructor

Create a new instance of the MemoryMessageQueue class.

 

constructor(clientId: Guid)

 

MemoryMessageQueue(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 MessageQueue and MessageQueue 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

Stores the provided serialized event message in the queue.

 

method QueueMessage(message: Stream)

 

void QueueMessage(Stream message)

 

Sub QueueMessage(message As Stream)

Parameters:

  • message: Message instance containing serialized event data

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 MessageQueue and MessageQueue methods pair.

 

method Unlock

 

void Unlock()

 

Sub Unlock

See Also