Package org.apache.pekko.routing
Class Router
java.lang.Object
org.apache.pekko.routing.Router
- All Implemented Interfaces:
Serializable
,scala.Equals
,scala.Product
For each message that is sent through the router via the
route(java.lang.Object, org.apache.pekko.actor.ActorRef)
method the
RoutingLogic
decides to which Routee
to send the message. The Routee
itself
knows how to perform the actual sending. Normally the RoutingLogic
picks one of the
contained routees
, but that is up to the implementation of the RoutingLogic
.
A Router
is immutable and the RoutingLogic
must be thread safe.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRouter
(RoutingLogic logic) Java APIRouter
(RoutingLogic logic, Iterable<Routee> routees) Java APIRouter
(RoutingLogic logic, scala.collection.immutable.IndexedSeq<Routee> routees) -
Method Summary
Modifier and TypeMethodDescriptionstatic scala.collection.immutable.IndexedSeq<Routee>
Create a new instance with one moreActorRefRoutee
for the specifiedpekko.actor.ActorRef
and the sameRoutingLogic
.addRoutee
(ActorSelection sel) Create a new instance with one moreActorSelectionRoutee
for the specifiedpekko.actor.ActorSelection
and the sameRoutingLogic
.Create a new instance with one more routee and the sameRoutingLogic
.static Router
apply
(RoutingLogic logic, scala.collection.immutable.IndexedSeq<Routee> routees) static scala.collection.immutable.IndexedSeq<Routee>
boolean
copy
(RoutingLogic logic, scala.collection.immutable.IndexedSeq<Routee> routees) scala.collection.immutable.IndexedSeq<Routee>
boolean
int
hashCode()
logic()
int
productElement
(int x$1) productElementName
(int x$1) scala.collection.Iterator<Object>
removeRoutee
(ActorRef ref) Create a new instance without theActorRefRoutee
for the specifiedpekko.actor.ActorRef
.Create a new instance without theActorSelectionRoutee
for the specifiedpekko.actor.ActorSelection
.removeRoutee
(Routee routee) Create a new instance without the specified routee.void
Send the message to the destinationRoutee
selected by theRoutingLogic
.scala.collection.immutable.IndexedSeq<Routee>
routees()
toString()
static scala.Option<scala.Tuple2<RoutingLogic,
scala.collection.immutable.IndexedSeq<Routee>>> withRoutees
(scala.collection.immutable.IndexedSeq<Routee> rs) Create a new instance with the specified routees and the sameRoutingLogic
.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface scala.Product
productElementNames
-
Constructor Details
-
Router
-
Router
Java API -
Router
Java API
-
-
Method Details
-
$lessinit$greater$default$2
-
apply
public static Router apply(RoutingLogic logic, scala.collection.immutable.IndexedSeq<Routee> routees) -
apply$default$2
-
unapply
public static scala.Option<scala.Tuple2<RoutingLogic,scala.collection.immutable.IndexedSeq<Routee>>> unapply(Router x$0) -
logic
-
routees
-
route
Send the message to the destinationRoutee
selected by theRoutingLogic
. If the message is apekko.routing.RouterEnvelope
it will be unwrapped before sent to the destinations. Messages wrapped in aBroadcast
envelope are always sent to allroutees
. -
withRoutees
Create a new instance with the specified routees and the sameRoutingLogic
. -
addRoutee
Create a new instance with one more routee and the sameRoutingLogic
. -
addRoutee
Create a new instance with one moreActorRefRoutee
for the specifiedpekko.actor.ActorRef
and the sameRoutingLogic
. -
addRoutee
Create a new instance with one moreActorSelectionRoutee
for the specifiedpekko.actor.ActorSelection
and the sameRoutingLogic
. -
removeRoutee
Create a new instance without the specified routee. -
removeRoutee
Create a new instance without theActorRefRoutee
for the specifiedpekko.actor.ActorRef
. -
removeRoutee
Create a new instance without theActorSelectionRoutee
for the specifiedpekko.actor.ActorSelection
. -
copy
-
copy$default$1
-
copy$default$2
-
productPrefix
- Specified by:
productPrefix
in interfacescala.Product
-
productArity
public int productArity()- Specified by:
productArity
in interfacescala.Product
-
productElement
- Specified by:
productElement
in interfacescala.Product
-
productIterator
- Specified by:
productIterator
in interfacescala.Product
-
canEqual
- Specified by:
canEqual
in interfacescala.Equals
-
productElementName
- Specified by:
productElementName
in interfacescala.Product
-
hashCode
public int hashCode() -
toString
-
equals
-