Class Router
Implements a router - including:
- The RoutingLogic
- The Routees
It's used internally by the routing system
Inherited Members
Namespace: Akka.Routing
Assembly: Akka.dll
Syntax
public class Router
Constructors
| Improve this Doc View SourceRouter(RoutingLogic, Routee[])
TBD
Declaration
public Router(RoutingLogic logic, params Routee[] routees)
Parameters
Type | Name | Description |
---|---|---|
RoutingLogic | logic | TBD |
Routee[] | routees | TBD |
Properties
| Improve this Doc View SourceRoutees
The set of Routees that this router is currently targeting.
Declaration
public IEnumerable<Routee> Routees { get; }
Property Value
Type | Description |
---|---|
IEnumerable<Routee> |
RoutingLogic
The logic used to determine which Routee will process a given message.
Declaration
public RoutingLogic RoutingLogic { get; }
Property Value
Type | Description |
---|---|
RoutingLogic |
Methods
| Improve this Doc View SourceAddRoutee(ActorSelection)
Create a new instance with one more routee and the same RoutingLogic.
Declaration
public Router AddRoutee(ActorSelection routee)
Parameters
Type | Name | Description |
---|---|---|
ActorSelection | routee | TBD |
Returns
Type | Description |
---|---|
Router | TBD |
AddRoutee(IActorRef)
Create a new instance with one more routee and the same RoutingLogic.
Declaration
public Router AddRoutee(IActorRef routee)
Parameters
Type | Name | Description |
---|---|---|
IActorRef | routee | TBD |
Returns
Type | Description |
---|---|
Router | TBD |
AddRoutee(Routee)
Create a new instance with one more routee and the same RoutingLogic.
Declaration
public virtual Router AddRoutee(Routee routee)
Parameters
Type | Name | Description |
---|---|---|
Routee | routee | The routee to add. |
Returns
Type | Description |
---|---|
Router | A new Router instance with this routee added. |
RemoveRoutee(ActorSelection)
Create a new instance without the specified routee.
Declaration
public Router RemoveRoutee(ActorSelection routee)
Parameters
Type | Name | Description |
---|---|---|
ActorSelection | routee | The ActorSelection routee to remove. |
Returns
Type | Description |
---|---|
Router | A new Router instance with this same configuration, sans routee. |
RemoveRoutee(IActorRef)
Create a new instance without the specified routee.
Declaration
public Router RemoveRoutee(IActorRef routee)
Parameters
Type | Name | Description |
---|---|---|
IActorRef | routee | The IActorRef routee to remove. |
Returns
Type | Description |
---|---|
Router | A new Router instance with this same configuration, sans routee. |
RemoveRoutee(Routee)
Create a new instance without the specified routee.
Declaration
public virtual Router RemoveRoutee(Routee routee)
Parameters
Type | Name | Description |
---|---|---|
Routee | routee | The routee to remove. |
Returns
Type | Description |
---|---|
Router | A new Router instance with this same configuration, sans routee. |
Route(Object, IActorRef)
Uses the RoutingLogic to select an appropriate routee (or routees) and then delivers the message to them via Tell(Object, IActorRef).
Declaration
public virtual void Route(object message, IActorRef sender)
Parameters
Type | Name | Description |
---|---|---|
Object | message | The message to send. |
IActorRef | sender | The sender of this message - which will be propagated to the routee. |
Send(Routee, Object, IActorRef)
Sends the message to the routee from the sender - and unwraps any special RouterEnvelopeS first so the routee only receives the intended message.
Declaration
protected virtual void Send(Routee routee, object message, IActorRef sender)
Parameters
Type | Name | Description |
---|---|---|
Routee | routee | The routee who has been selected by the RoutingLogic. |
Object | message | The message to send. |
IActorRef | sender | The sender of this message - which will be propagated to the routee. |
UnWrap(Object)
Declaration
protected object UnWrap(object message)
Parameters
Type | Name | Description |
---|---|---|
Object | message |
Returns
Type | Description |
---|---|
Object |
WithRoutees(Routee[])
Create a new instance with the specified routees and the same RoutingLogic.
Declaration
public virtual Router WithRoutees(params Routee[] routees)
Parameters
Type | Name | Description |
---|---|---|
Routee[] | routees | The routees to add. |
Returns
Type | Description |
---|---|
Router | A new Router instance with these routees added. |