Class TailChoppingPool
This class represents a Pool router that sends messages to a Routee determined using tail-chopping. This process has the router select a random routee, then waits an interval before sending to a different randomly chosen routee. The first response is used and the remaining are discarded. If the none of the routees respond within a specified time limit, a timeout failure occurs.
Inherited Members
Namespace: Akka.Routing
Assembly: Akka.dll
Syntax
public sealed class TailChoppingPool : Pool, ISurrogated, IEquatable<RouterConfig>, IEquatable<Pool>
Constructors
| Improve this Doc View SourceTailChoppingPool(Config)
Initializes a new instance of the TailChoppingPool class.
note
'nr-of-instances', 'within', and 'tail-chopping-router.interval' must be defined in the provided configuration.
Declaration
public TailChoppingPool(Config config)
Parameters
Type | Name | Description |
---|---|---|
Config | config | The configuration used to configure the pool. |
TailChoppingPool(Int32, Resizer, SupervisorStrategy, String, TimeSpan, TimeSpan, Boolean)
Initializes a new instance of the TailChoppingPool class.
Declaration
public TailChoppingPool(int nrOfInstances, Resizer resizer, SupervisorStrategy supervisorStrategy, string routerDispatcher, TimeSpan within, TimeSpan interval, 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. |
TimeSpan | within | The amount of time to wait for a response. |
TimeSpan | interval | The interval to wait before sending to the next routee. |
Boolean | usePoolDispatcher |
|
TailChoppingPool(Int32, TimeSpan, TimeSpan)
Initializes a new instance of the TailChoppingPool class.
Declaration
public TailChoppingPool(int nrOfInstances, TimeSpan within, TimeSpan interval)
Parameters
Type | Name | Description |
---|---|---|
Int32 | nrOfInstances | The initial number of routees in the pool. |
TimeSpan | within | The amount of time to wait for a response. |
TimeSpan | interval | The interval to wait before sending to the next routee. |
Properties
| Improve this Doc View SourceInterval
The amount of time to wait before sending to the next routee.
Declaration
public TimeSpan Interval { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
Within
The amount of time to wait for a response.
Declaration
public TimeSpan Within { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
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 system)
Parameters
Type | Name | Description |
---|---|---|
ActorSystem | system | 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 TailChoppingPool.
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 TailChoppingPool. |
Overrides
| Improve this Doc View SourceWithDispatcher(String)
Creates a new TailChoppingPool router with a given dispatcher id.
note
This method is immutable and returns a new instance of the router.
Declaration
public TailChoppingPool WithDispatcher(string dispatcher)
Parameters
Type | Name | Description |
---|---|---|
String | dispatcher | The dispatcher id used to configure the new router. |
Returns
Type | Description |
---|---|
TailChoppingPool | 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 TailChoppingPool router with a given Resizer.
note
This method is immutable and returns a new instance of the router.
Declaration
public TailChoppingPool WithResizer(Resizer resizer)
Parameters
Type | Name | Description |
---|---|---|
Resizer | resizer | The Resizer used to configure the new router. |
Returns
Type | Description |
---|---|
TailChoppingPool | A new router with the provided |
WithSupervisorStrategy(SupervisorStrategy)
Creates a new TailChoppingPool router with a given SupervisorStrategy.
note
This method is immutable and returns a new instance of the router.
Declaration
public TailChoppingPool WithSupervisorStrategy(SupervisorStrategy strategy)
Parameters
Type | Name | Description |
---|---|---|
SupervisorStrategy | strategy | The SupervisorStrategy used to configure the new router. |
Returns
Type | Description |
---|---|
TailChoppingPool | A new router with the provided |