Interface Receptionist.Listing
-
- All Known Implementing Classes:
ReceptionistMessages.Listing
- Enclosing class:
- Receptionist
public static interface Receptionist.Listing
Current listing of all Actors that implement the protocol given by theServiceKey
.You can use
key.Listing
for type-safe pattern matching.Not for user extension.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> scala.collection.immutable.Set<ActorRef<T>>
allServiceInstances(ServiceKey<T> key)
Scala API: Return both the reachable and the unreachable service instances.<T> java.util.Set<ActorRef<T>>
getAllServiceInstances(ServiceKey<T> key)
Java API: Return both the reachable and the unreachable service instances.ServiceKey<?>
getKey()
Java API<T> java.util.Set<ActorRef<T>>
getServiceInstances(ServiceKey<T> key)
Java API: Return the reachable service instances.boolean
isForKey(ServiceKey<?> key)
ServiceKey<?>
key()
Scala API<T> scala.collection.immutable.Set<ActorRef<T>>
serviceInstances(ServiceKey<T> key)
Scala API: Return the reachable service instances.boolean
servicesWereAddedOrRemoved()
Returnstrue
only if thisListing
was sent triggered by new actors added or removed to the receptionist.
-
-
-
Method Detail
-
key
ServiceKey<?> key()
Scala API
-
getKey
ServiceKey<?> getKey()
Java API
-
isForKey
boolean isForKey(ServiceKey<?> key)
-
serviceInstances
<T> scala.collection.immutable.Set<ActorRef<T>> serviceInstances(ServiceKey<T> key)
Scala API: Return the reachable service instances.In a non-clustered
ActorSystem
this will always be all registered instances for a service key.For a clustered
ActorSystem
it 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(akka.actor.typed.receptionist.ServiceKey<T>)
Also, see
ServiceKey.Listing
for more convenient pattern matching
-
getServiceInstances
<T> java.util.Set<ActorRef<T>> getServiceInstances(ServiceKey<T> key)
Java API: Return the reachable service instances.In a non-clustered
ActorSystem
this will always be all registered instances for a service key.For a clustered
ActorSystem
it 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(akka.actor.typed.receptionist.ServiceKey<T>)
-
allServiceInstances
<T> scala.collection.immutable.Set<ActorRef<T>> allServiceInstances(ServiceKey<T> key)
Scala API: Return both the reachable and the unreachable service instances.In a non-clustered
ActorSystem
this will always be the same asserviceInstances(akka.actor.typed.receptionist.ServiceKey<T>)
.For a clustered
ActorSystem
this include both services on nodes that are reachable and nodes that are unreachable.
-
getAllServiceInstances
<T> java.util.Set<ActorRef<T>> getAllServiceInstances(ServiceKey<T> key)
Java API: Return both the reachable and the unreachable service instances.In a non-clustered
ActorSystem
this will always be the same asgetServiceInstances(akka.actor.typed.receptionist.ServiceKey<T>)
.For a clustered
ActorSystem
this include both services on nodes that are reachable and nodes that are unreachable.
-
servicesWereAddedOrRemoved
boolean servicesWereAddedOrRemoved()
Returnstrue
only if thisListing
was sent triggered by new actors added or removed to the receptionist. Whenfalse
the event is only about reachability changes - meaning that the full set of actors (allServiceInstances(akka.actor.typed.receptionist.ServiceKey<T>)
orgetAllServiceInstances(akka.actor.typed.receptionist.ServiceKey<T>)
) is the same as the previousListing
.knowing this is useful for subscribers only concerned with
allServiceInstances(akka.actor.typed.receptionist.ServiceKey<T>)
orgetAllServiceInstances(akka.actor.typed.receptionist.ServiceKey<T>)
that can then ignoreListing
s related to reachability.In a non-clustered
ActorSystem
this will betrue
for all listings. ForFind
queries and the initial listing for aSubscribe
this will always betrue
.
-
-