Class PoolRouterBuilder<T>
- java.lang.Object
-
- akka.actor.typed.Behavior<T>
-
- akka.actor.typed.Behavior.DeferredBehavior<T>
-
- akka.actor.typed.javadsl.PoolRouter<T>
-
- akka.actor.typed.internal.routing.PoolRouterBuilder<T>
-
- All Implemented Interfaces:
PoolRouter<T>
,java.io.Serializable
,scala.Equals
,scala.Product
,scala.Serializable
public final class PoolRouterBuilder<T> extends PoolRouter<T> implements PoolRouter<T>, scala.Product, scala.Serializable
INTERNAL API- See Also:
- Serialized Form
-
-
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 PoolRouterBuilder(int poolSize, Behavior<T> behavior, scala.Function0<RoutingLogic<T>> logicFactory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> scala.Function0<RoutingLogics.RoundRobinLogic<T>>
$lessinit$greater$default$3()
Behavior<T>
apply(TypedActorContext<T> ctx)
static <T> scala.Function0<RoutingLogics.RoundRobinLogic<T>>
apply$default$3()
Behavior<T>
behavior()
boolean
canEqual(java.lang.Object x$1)
<T> PoolRouterBuilder<T>
copy(int poolSize, Behavior<T> behavior, scala.Function0<RoutingLogic<T>> logicFactory)
<T> int
copy$default$1()
<T> Behavior<T>
copy$default$2()
<T> scala.Function0<RoutingLogic<T>>
copy$default$3()
boolean
equals(java.lang.Object x$1)
int
hashCode()
scala.Function0<RoutingLogic<T>>
logicFactory()
int
poolSize()
int
productArity()
java.lang.Object
productElement(int x$1)
scala.collection.Iterator<java.lang.Object>
productIterator()
java.lang.String
productPrefix()
java.lang.String
toString()
static <T> scala.Option<scala.Tuple3<java.lang.Object,Behavior<T>,scala.Function0<RoutingLogic<T>>>>
unapply(PoolRouterBuilder<T> x$0)
PoolRouterBuilder<T>
withPoolSize(int poolSize)
Set a new pool size from the one set at constructionPoolRouterBuilder<T>
withRandomRouting()
Route messages by randomly selecting the routee from the available routees.PoolRouterBuilder<T>
withRoundRobinRouting()
Route messages through round robin, providing a fair distribution of messages across the routees.-
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
-
-
-
-
Constructor Detail
-
PoolRouterBuilder
public PoolRouterBuilder(int poolSize, Behavior<T> behavior, scala.Function0<RoutingLogic<T>> logicFactory)
-
-
Method Detail
-
$lessinit$greater$default$3
public static <T> scala.Function0<RoutingLogics.RoundRobinLogic<T>> $lessinit$greater$default$3()
-
apply$default$3
public static <T> scala.Function0<RoutingLogics.RoundRobinLogic<T>> apply$default$3()
-
unapply
public static <T> scala.Option<scala.Tuple3<java.lang.Object,Behavior<T>,scala.Function0<RoutingLogic<T>>>> unapply(PoolRouterBuilder<T> x$0)
-
poolSize
public int poolSize()
-
logicFactory
public scala.Function0<RoutingLogic<T>> logicFactory()
-
apply
public Behavior<T> apply(TypedActorContext<T> ctx)
- Specified by:
apply
in classBehavior.DeferredBehavior<T>
-
withRandomRouting
public PoolRouterBuilder<T> withRandomRouting()
Description copied from interface:PoolRouter
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.- Specified by:
withRandomRouting
in interfacePoolRouter<T>
- Specified by:
withRandomRouting
in classPoolRouter<T>
- Returns:
- (undocumented)
-
withRoundRobinRouting
public PoolRouterBuilder<T> withRoundRobinRouting()
Description copied from class:PoolRouter
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.
- Specified by:
withRoundRobinRouting
in interfacePoolRouter<T>
- Specified by:
withRoundRobinRouting
in classPoolRouter<T>
- Returns:
- (undocumented)
-
withPoolSize
public PoolRouterBuilder<T> withPoolSize(int poolSize)
Description copied from class:PoolRouter
Set a new pool size from the one set at construction- Specified by:
withPoolSize
in interfacePoolRouter<T>
- Specified by:
withPoolSize
in classPoolRouter<T>
- Parameters:
poolSize
- (undocumented)- Returns:
- (undocumented)
-
copy
public <T> PoolRouterBuilder<T> copy(int poolSize, Behavior<T> behavior, scala.Function0<RoutingLogic<T>> logicFactory)
-
copy$default$1
public <T> int copy$default$1()
-
copy$default$2
public <T> Behavior<T> copy$default$2()
-
copy$default$3
public <T> scala.Function0<RoutingLogic<T>> copy$default$3()
-
productPrefix
public java.lang.String productPrefix()
- Specified by:
productPrefix
in interfacescala.Product
-
productArity
public int productArity()
- Specified by:
productArity
in interfacescala.Product
-
productElement
public java.lang.Object productElement(int x$1)
- Specified by:
productElement
in interfacescala.Product
-
productIterator
public scala.collection.Iterator<java.lang.Object> productIterator()
- Specified by:
productIterator
in interfacescala.Product
-
canEqual
public boolean canEqual(java.lang.Object x$1)
- Specified by:
canEqual
in interfacescala.Equals
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object x$1)
- Specified by:
equals
in interfacescala.Equals
- Overrides:
equals
in classjava.lang.Object
-
-