Class RoundRobinPool
This class represents a Pool router that sends messages to a Routee determined using round-robin. This process has the router select from a list of routees in sequential order. When the list has been exhausted, the router iterates again from the beginning of the list.
note
For concurrent calls, round robin is just a best effort.
Inherited Members
Namespace: Akka.Routing
Assembly: Akka.dll
Syntax
public sealed class RoundRobinPool : Pool, ISurrogated, IEquatable<RouterConfig>, IEquatable<Pool>
Constructors
| Improve this Doc View SourceRoundRobinPool(Config)
Initializes a new instance of the RoundRobinPool class.
Declaration
public RoundRobinPool(Config config)
Parameters
Type | Name | Description |
---|---|---|
Config | config | The configuration used to configure the pool. |
RoundRobinPool(Int32)
Initializes a new instance of the RoundRobinPool class.
note
A RoundRobinPool configured in this way uses the DefaultSupervisorStrategy supervisor strategy.
Declaration
public RoundRobinPool(int nrOfInstances)
Parameters
Type | Name | Description |
---|---|---|
Int32 | nrOfInstances | The initial number of routees in the pool. |
RoundRobinPool(Int32, Resizer)
Initializes a new instance of the RoundRobinPool class.
note
A RoundRobinPool configured in this way uses the DefaultSupervisorStrategy supervisor strategy.
Declaration
public RoundRobinPool(int nrOfInstances, Resizer resizer)
Parameters
Type | Name | Description |
---|---|---|
Int32 | nrOfInstances | The initial number of routees in the pool. |
Resizer | resizer | The resizer to use when dynamically allocating routees to the pool. |
RoundRobinPool(Int32, Resizer, SupervisorStrategy, String, Boolean)
Initializes a new instance of the RoundRobinPool class.
Declaration
public RoundRobinPool(int nrOfInstances, Resizer resizer, SupervisorStrategy supervisorStrategy, string routerDispatcher, bool usePoolDispatcher = false)
Parameters
Type | Name | Description |
---|---|---|
Int32 | nrOfInstances | The initial number of routees in the pool. |
Resizer | resizer | The resizer to use when dynamically allocating routees to the pool. |
SupervisorStrategy | supervisorStrategy | The strategy to use when supervising the pool. |
String | routerDispatcher | The dispatcher to use when passing messages to the routees. |
Boolean | usePoolDispatcher |
|
Methods
| Improve this Doc View SourceCreateRouter(ActorSystem)
Creates a router that is responsible for routing messages to routees within the provided system
.
Declaration
public override Router CreateRouter(ActorSystem system)
Parameters
Type | Name | Description |
---|---|---|
ActorSystem | system | The actor system that owns this router. |
Returns
Type | Description |
---|---|
Router | The newly created router tied to the given system. |
Overrides
| Improve this Doc View SourceGetNrOfInstances(ActorSystem)
Used by the Akka.Routing.RoutedActorCell to determine the initial number of routees.
Declaration
public override int GetNrOfInstances(ActorSystem sys)
Parameters
Type | Name | Description |
---|---|---|
ActorSystem | sys | The actor system that owns this router. |
Returns
Type | Description |
---|---|
Int32 | The number of routees associated with this pool. |
Overrides
| Improve this Doc View SourceToSurrogate(ActorSystem)
Creates a surrogate representation of the current RoundRobinPool.
Declaration
public override ISurrogate ToSurrogate(ActorSystem system)
Parameters
Type | Name | Description |
---|---|---|
ActorSystem | system | The actor system that owns this router. |
Returns
Type | Description |
---|---|
ISurrogate | The surrogate representation of the current RoundRobinPool. |
Overrides
| Improve this Doc View SourceWithDispatcher(String)
Creates a new RoundRobinPool router with a given dispatcher id.
note
This method is immutable and returns a new instance of the router.
Declaration
public RoundRobinPool WithDispatcher(string dispatcher)
Parameters
Type | Name | Description |
---|---|---|
String | dispatcher | The dispatcher id used to configure the new router. |
Returns
Type | Description |
---|---|
RoundRobinPool | A new router with the provided dispatcher id. |
WithFallback(RouterConfig)
Configure the current router with an auxiliary router for routes that it does not know how to handle.
Declaration
public override RouterConfig WithFallback(RouterConfig routerConfig)
Parameters
Type | Name | Description |
---|---|---|
RouterConfig | routerConfig | The router to use as an auxiliary source. |
Returns
Type | Description |
---|---|
RouterConfig | The router configured with the auxiliary information. |
Overrides
| Improve this Doc View SourceWithResizer(Resizer)
Creates a new RoundRobinPool router with a given Resizer.
note
This method is immutable and returns a new instance of the router.
Declaration
public RoundRobinPool WithResizer(Resizer resizer)
Parameters
Type | Name | Description |
---|---|---|
Resizer | resizer | The Resizer used to configure the new router. |
Returns
Type | Description |
---|---|
RoundRobinPool | A new router with the provided |
WithSupervisorStrategy(SupervisorStrategy)
Creates a new RoundRobinPool router with a given SupervisorStrategy.
note
This method is immutable and returns a new instance of the router.
Declaration
public RoundRobinPool WithSupervisorStrategy(SupervisorStrategy strategy)
Parameters
Type | Name | Description |
---|---|---|
SupervisorStrategy | strategy | The SupervisorStrategy used to configure the new router. |
Returns
Type | Description |
---|---|
RoundRobinPool | A new router with the provided |