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 moreActorRefRouteefor the specifiedpekko.actor.ActorRefand the sameRoutingLogic.addRoutee(ActorSelection sel) Create a new instance with one moreActorSelectionRouteefor the specifiedpekko.actor.ActorSelectionand the sameRoutingLogic.Create a new instance with one more routee and the sameRoutingLogic.static Routerapply(RoutingLogic logic, scala.collection.immutable.IndexedSeq<Routee> routees) static scala.collection.immutable.IndexedSeq<Routee>booleancopy(RoutingLogic logic, scala.collection.immutable.IndexedSeq<Routee> routees) scala.collection.immutable.IndexedSeq<Routee>booleaninthashCode()logic()intproductElement(int x$1) productElementName(int x$1) scala.collection.Iterator<Object>removeRoutee(ActorRef ref) Create a new instance without theActorRefRouteefor the specifiedpekko.actor.ActorRef.Create a new instance without theActorSelectionRouteefor the specifiedpekko.actor.ActorSelection.removeRoutee(Routee routee) Create a new instance without the specified routee.voidSend the message to the destinationRouteeselected 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, waitMethods 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 destinationRouteeselected by theRoutingLogic. If the message is apekko.routing.RouterEnvelopeit will be unwrapped before sent to the destinations. Messages wrapped in aBroadcastenvelope 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 moreActorRefRouteefor the specifiedpekko.actor.ActorRefand the sameRoutingLogic. -
addRoutee
Create a new instance with one moreActorSelectionRouteefor the specifiedpekko.actor.ActorSelectionand the sameRoutingLogic. -
removeRoutee
Create a new instance without the specified routee. -
removeRoutee
Create a new instance without theActorRefRouteefor the specifiedpekko.actor.ActorRef. -
removeRoutee
Create a new instance without theActorSelectionRouteefor the specifiedpekko.actor.ActorSelection. -
copy
-
copy$default$1
-
copy$default$2
-
productPrefix
- Specified by:
productPrefixin interfacescala.Product
-
productArity
public int productArity()- Specified by:
productArityin interfacescala.Product
-
productElement
- Specified by:
productElementin interfacescala.Product
-
productIterator
- Specified by:
productIteratorin interfacescala.Product
-
canEqual
- Specified by:
canEqualin interfacescala.Equals
-
productElementName
- Specified by:
productElementNamein interfacescala.Product
-
hashCode
public int hashCode() -
toString
-
equals
-