Class DequeWrapperMessageQueue
Message queue for supporting IDequeBasedMessageQueueSemantics within Mailbox instances.
Uses a Stack<T> internally - each individual EnqueueFirst(Envelope)
Inherited Members
Namespace: Akka.Dispatch.MessageQueues
Assembly: Akka.dll
Syntax
public class DequeWrapperMessageQueue : IMessageQueue, IDequeBasedMessageQueueSemantics, ISemantics
Constructors
| Improve this Doc View SourceDequeWrapperMessageQueue(IMessageQueue)
Takes another IMessageQueue as an argument - wraps messageQueue
in order to provide it with prepend (EnqueueFirst(Envelope)) semantics.
Declaration
public DequeWrapperMessageQueue(IMessageQueue messageQueue)
Parameters
Type | Name | Description |
---|---|---|
IMessageQueue | messageQueue | The underlying message queue wrapped by this one. |
Fields
| Improve this Doc View SourceMessageQueue
The underlying IMessageQueue.
Declaration
protected readonly IMessageQueue MessageQueue
Field Value
Type | Description |
---|---|
IMessageQueue |
Properties
| Improve this Doc View SourceCount
Returns the number of messages in both the internal message queue and the prepend buffer.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
Int32 |
HasMessages
Returns true if there are any messages inside the queue.
Declaration
public bool HasMessages { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
| Improve this Doc View SourceCleanUp(IActorRef, IMessageQueue)
Interface to be implemented by all mailbox message queues
Declaration
public void CleanUp(IActorRef owner, IMessageQueue deadletters)
Parameters
Type | Name | Description |
---|---|---|
IActorRef | owner | The owner of this message queue if available, "/deadletters" otherwise. |
IMessageQueue | deadletters | The dead letters message queue. |
Enqueue(IActorRef, Envelope)
Interface to be implemented by all mailbox message queues
Declaration
public void Enqueue(IActorRef receiver, Envelope envelope)
Parameters
Type | Name | Description |
---|---|---|
IActorRef | receiver | The receiver of the messages. This field is only used in a couple of places, but it should not be removed. |
Envelope | envelope | The envelope to enqueue |
EnqueueFirst(Envelope)
Add a message to the front of the queue via the prepend buffer.
Declaration
public void EnqueueFirst(Envelope envelope)
Parameters
Type | Name | Description |
---|---|---|
Envelope | envelope | The message we wish to append to the front of the queue. |
TryDequeue(out Envelope)
Attempt to dequeue a message from the front of the prepend buffer.
If the prepend buffer is empty, dequeue a message from the normal IMessageQueue wrapped but this wrapper.
Declaration
public bool TryDequeue(out Envelope envelope)
Parameters
Type | Name | Description |
---|---|---|
Envelope | envelope | The message to return, if any |
Returns
Type | Description |
---|---|
Boolean |
|