Class UnboundedStablePriorityMailbox
Priority mailbox - an unbounded mailbox that allows for prioritization of its contents. Extend this class and implement the PriorityGenerator(Object) method with your own prioritization. The value returned by the PriorityGenerator(Object) method will be used to order the message in the mailbox. Lower values will be delivered first. Messages ordered by the same number will remain in delivery order.
Inherited Members
Namespace: Akka.Dispatch
Assembly: Akka.dll
Syntax
public abstract class UnboundedStablePriorityMailbox : MailboxType, IProducesMessageQueue<UnboundedStablePriorityMessageQueue>
Constructors
| Improve this Doc View SourceUnboundedStablePriorityMailbox(Settings, Config)
Constructor used for creating a MailboxType
Declaration
protected UnboundedStablePriorityMailbox(Settings settings, Config config)
Parameters
Type | Name | Description |
---|---|---|
Settings | settings | The Settings for this system. |
Config | config | The Config for this mailbox. |
Fields
| Improve this Doc View SourceDefaultCapacity
The default capacity of an unbounded priority mailbox.
Declaration
public const int DefaultCapacity = 11
Field Value
Type | Description |
---|---|
Int32 |
Properties
| Improve this Doc View SourceInitialCapacity
The initial capacity of the unbounded mailbox.
Declaration
public int InitialCapacity { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
| Improve this Doc View SourceCreate(IActorRef, ActorSystem)
A factory to create IMessageQueues for an optionally provided IActorContext.
Declaration
public sealed override IMessageQueue Create(IActorRef owner, ActorSystem system)
Parameters
Type | Name | Description |
---|---|---|
IActorRef | owner | |
ActorSystem | system |
Returns
Type | Description |
---|---|
IMessageQueue |
Overrides
Remarks
Possibly important notice.
When implementing a custom MailboxType, be aware that there is special semantics attached to ActorOf(Props, String) in that sending the returned IActorRef may, for a short period of time, enqueue the messages first in a dummy queue. Top-level actors are created in two steps, and only after the guardian actor ahs performed that second step will all previously sent messages be transferred from the dummy queue to the real mailbox.
Implemented as an abstract class in order to enforce constructor requirements.
PriorityGenerator(Object)
Function responsible for generating the priority value of a message based on its type and content.
Declaration
protected abstract int PriorityGenerator(object message)
Parameters
Type | Name | Description |
---|---|---|
Object | message | The message to inspect. |
Returns
Type | Description |
---|---|
Int32 | An integer. The lower the value, the higher the priority. |