Class RoundRobinGroup
This class represents a Group 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.
note
The configuration parameter trumps the constructor arguments. This means that if you provide `paths` during instantiation they will be ignored if the router is defined in the configuration file for the actor being used.
Inherited Members
Namespace: Akka.Routing
Assembly: Akka.dll
Syntax
public sealed class RoundRobinGroup : Group, ISurrogated, IEquatable<RouterConfig>, IEquatable<Group>
Constructors
| Edit this page View SourceRoundRobinGroup(Config)
Initializes a new instance of the RoundRobinGroup class.
Declaration
public RoundRobinGroup(Config config)
Parameters
Type | Name | Description |
---|---|---|
Config | config | The configuration to use to lookup paths used by the group router. noteIf 'routees.path' is defined in the provided configuration then those paths will be used by the router. |
RoundRobinGroup(IEnumerable<string>)
Initializes a new instance of the RoundRobinGroup class.
Declaration
public RoundRobinGroup(IEnumerable<string> paths)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<string> | paths | An enumeration of actor paths used by the group router. |
RoundRobinGroup(IEnumerable<string>, string)
Initializes a new instance of the RoundRobinGroup class.
Declaration
public RoundRobinGroup(IEnumerable<string> paths, string routerDispatcher)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<string> | paths | A list of paths used by the group router. |
string | routerDispatcher | The dispatcher to use when passing messages to routees. |
RoundRobinGroup(params string[])
Initializes a new instance of the RoundRobinGroup class.
Declaration
public RoundRobinGroup(params string[] paths)
Parameters
Type | Name | Description |
---|---|---|
string[] | paths | A list of paths used by the group router. |
Methods
| Edit this page 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
| Edit this page View SourceGetPaths(ActorSystem)
Retrieves the actor paths used by this router during routee selection.
Declaration
public override IEnumerable<string> GetPaths(ActorSystem system)
Parameters
Type | Name | Description |
---|---|---|
ActorSystem | system | The actor system that owns this router. |
Returns
Type | Description |
---|---|
IEnumerable<string> | An enumeration of actor paths used during routee selection |
Overrides
| Edit this page View SourceToSurrogate(ActorSystem)
Creates a surrogate representation of the current RoundRobinGroup.
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 RoundRobinGroup. |
Overrides
| Edit this page View SourceWithDispatcher(string)
Creates a new RoundRobinGroup router with a given dispatcher id.
note
This method is immutable and returns a new instance of the router.
Declaration
public Group WithDispatcher(string dispatcherId)
Parameters
Type | Name | Description |
---|---|---|
string | dispatcherId | The dispatcher id used to configure the new router. |
Returns
Type | Description |
---|---|
Group | A new router with the provided dispatcher id. |