Interface Receptionist.Listing
- All Known Implementing Classes:
ReceptionistMessages.Listing
- Enclosing class:
- Receptionist
ServiceKey.
You can use key.Listing for type-safe pattern matching.
Not for user extension.
-
Method Summary
Modifier and TypeMethodDescription<T> scala.collection.immutable.Set<ActorRef<T>>allServiceInstances(ServiceKey<T> key) Scala API: Return both the reachable and the unreachable service instances.getAllServiceInstances(ServiceKey<T> key) Java API: Return both the reachable and the unreachable service instances.ServiceKey<?>getKey()Java APIgetServiceInstances(ServiceKey<T> key) Java API: Return the reachable service instances.booleanisForKey(ServiceKey<?> key) ServiceKey<?>key()Scala API<T> scala.collection.immutable.Set<ActorRef<T>>serviceInstances(ServiceKey<T> key) Scala API: Return the reachable service instances.booleanReturnstrueonly if thisListingwas sent triggered by new actors added or removed to the receptionist.
-
Method Details
-
key
ServiceKey<?> key()Scala API -
getKey
ServiceKey<?> getKey()Java API -
isForKey
-
serviceInstances
Scala API: Return the reachable service instances.In a non-clustered
ActorSystemthis will always be all registered instances for a service key.For a clustered
ActorSystemit only contain services on nodes that are not seen as unreachable (note that they could have still have become unreachable between this message being sent and the receiving actor processing it).For a list including both reachable and unreachable instances see
allServiceInstances(org.apache.pekko.actor.typed.receptionist.ServiceKey<T>)Also, see
ServiceKey.Listingfor more convenient pattern matching -
getServiceInstances
Java API: Return the reachable service instances.In a non-clustered
ActorSystemthis will always be all registered instances for a service key.For a clustered
ActorSystemit only contain services on nodes that has are not seen as unreachable (note that they could have still have become unreachable between this message being sent and the receiving actor processing it).For a list including both reachable and unreachable instances see
getAllServiceInstances(org.apache.pekko.actor.typed.receptionist.ServiceKey<T>) -
allServiceInstances
Scala API: Return both the reachable and the unreachable service instances.In a non-clustered
ActorSystemthis will always be the same asserviceInstances(org.apache.pekko.actor.typed.receptionist.ServiceKey<T>).For a clustered
ActorSystemthis include both services on nodes that are reachable and nodes that are unreachable. -
getAllServiceInstances
Java API: Return both the reachable and the unreachable service instances.In a non-clustered
ActorSystemthis will always be the same asgetServiceInstances(org.apache.pekko.actor.typed.receptionist.ServiceKey<T>).For a clustered
ActorSystemthis include both services on nodes that are reachable and nodes that are unreachable. -
servicesWereAddedOrRemoved
boolean servicesWereAddedOrRemoved()Returnstrueonly if thisListingwas sent triggered by new actors added or removed to the receptionist. Whenfalsethe event is only about reachability changes - meaning that the full set of actors (allServiceInstances(org.apache.pekko.actor.typed.receptionist.ServiceKey<T>)orgetAllServiceInstances(org.apache.pekko.actor.typed.receptionist.ServiceKey<T>)) is the same as the previousListing.knowing this is useful for subscribers only concerned with
allServiceInstances(org.apache.pekko.actor.typed.receptionist.ServiceKey<T>)orgetAllServiceInstances(org.apache.pekko.actor.typed.receptionist.ServiceKey<T>)that can then ignoreListings related to reachability.In a non-clustered
ActorSystemthis will betruefor all listings. ForFindqueries and the initial listing for aSubscribethis will always betrue.
-