Package akka.actor.typed.javadsl
Class PoolRouter<T>
- java.lang.Object
-
- akka.actor.typed.Behavior<T>
-
- akka.actor.typed.Behavior.DeferredBehavior<T>
-
- akka.actor.typed.javadsl.PoolRouter<T>
-
- Direct Known Subclasses:
PoolRouterBuilder
public abstract class PoolRouter<T> extends Behavior.DeferredBehavior<T>
Route messages by randomly selecting the routee from the available routees.Random routing makes it less likely that every
poolsize
message from a single producer ends up in the same mailbox of a slow actor.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class akka.actor.typed.Behavior
Behavior.BehaviorDecorators<T>, Behavior.BehaviorDecorators$, Behavior.DeferredBehavior<T>, Behavior.DeferredBehavior$, Behavior.EmptyBehavior$, Behavior.FailedBehavior, Behavior.IgnoreBehavior$, Behavior.SameBehavior$, Behavior.StoppedBehavior<T>, Behavior.StoppedBehavior$, Behavior.UnhandledBehavior$
-
-
Constructor Summary
Constructors Constructor Description PoolRouter()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract PoolRouter<T>
withPoolSize(int poolSize)
Set a new pool size from the one set at constructionabstract PoolRouter<T>
withRandomRouting()
abstract PoolRouter<T>
withRoundRobinRouting()
Route messages through round robin, providing a fair distribution of messages across the routees.-
Methods inherited from class akka.actor.typed.Behavior.DeferredBehavior
apply
-
Methods inherited from class akka.actor.typed.Behavior
_tag, BehaviorDecorators, canonicalize, empty, existsInStack, failed, ignore, interpretMessage, interpretSignal, isAlive, isDeferred, isUnhandled, narrow, orElse, same, start, stopped, stopped, unhandled, unhandledSignal, unsafeCast, validateAsInitial
-
-
-
-
Method Detail
-
withPoolSize
public abstract PoolRouter<T> withPoolSize(int poolSize)
Set a new pool size from the one set at construction- Parameters:
poolSize
- (undocumented)- Returns:
- (undocumented)
-
withRandomRouting
public abstract PoolRouter<T> withRandomRouting()
-
withRoundRobinRouting
public abstract PoolRouter<T> withRoundRobinRouting()
Route messages through round robin, providing a fair distribution of messages across the routees.Round robin gives fair routing where every available routee gets the same amount of messages
This is the default for pool routers.
- Returns:
- (undocumented)
-
-