Class Receptionist
- All Implemented Interfaces:
Extension
ServiceKey.
This class is not intended for user extension other than for test purposes (e.g. stub implementation). More methods may be added in the future and that may break such implementations.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe set of commands accepted by a Receptionist.static classRemove association between the givenpekko.actor.typed.ActorRefand the givenServiceKey.static interfaceConfirmation that the givenpekko.actor.typed.ActorRefno more associated with theServiceKeyin the local receptionist.static classSent by the receptionist, available here for easier testingstatic classFindmessage.static interfaceCurrent listing of all Actors that implement the protocol given by theServiceKey.static classSent by the receptionist, available here for easier testingstatic classRegistermessage.static interfaceConfirmation that the givenpekko.actor.typed.ActorRefhas been associated with theServiceKey.static classSent by the receptionist, available here for easier testingstatic classSubscribemessage. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final Tapply(ActorSystem<?> system) static ReceptionistcreateExtension(ActorSystem<?> system) static <T> Receptionist.Commandderegister(ServiceKey<T> key, ActorRef<T> service) Java API: A Deregister message without Ack that the service was unregisteredstatic <T> Receptionist.Commandderegister(ServiceKey<T> key, ActorRef<T> service, ActorRef<Receptionist.Deregistered> replyTo) Java API: A Deregister message with an actor that will get an ack that the service was unregisteredstatic <T> Receptionist.Deregisteredderegistered(ServiceKey<T> key, ActorRef<T> serviceInstance) Java API: Sent by the receptionist, available here for easier testingstatic final booleanstatic <T> Receptionist.Commandfind(ServiceKey<T> key, ActorRef<Receptionist.Listing> replyTo) Java API:Findmessage.static Receptionistget(ActorSystem<?> system) static final inthashCode()static ExtensionId<T>id()static <T> Receptionist.Listinglisting(ServiceKey<T> key, Set<ActorRef<T>> serviceInstances) Java API: Sent by the receptionist, available here for easier testingstatic <T> Receptionist.Listinglisting(ServiceKey<T> key, Set<ActorRef<T>> serviceInstances, Set<ActorRef<T>> allServiceInstances, boolean servicesWereAddedOrRemoved) Java API: Sent by the receptionist, available here for easier testingabstract ActorRef<Receptionist.Command>ref()static <T> Receptionist.Commandregister(ServiceKey<T> key, ActorRef<T> service) Java API: A Register message without Ack that the service was registered.static <T> Receptionist.Commandregister(ServiceKey<T> key, ActorRef<T> service, ActorRef<Receptionist.Registered> replyTo) Java API: ARegistermessage with Ack that the service was registered.static <T> Receptionist.Registeredregistered(ServiceKey<T> key, ActorRef<T> serviceInstance) Java API: Sent by the receptionist, available here for easier testingstatic <T> Receptionist.Commandsubscribe(ServiceKey<T> key, ActorRef<Receptionist.Listing> subscriber) Java API:Subscribemessage.
-
Constructor Details
-
Receptionist
public Receptionist()
-
-
Method Details
-
createExtension
-
get
-
register
Java API: A Register message without Ack that the service was registered. Associate the givenpekko.actor.typed.ActorRefwith the givenServiceKeyby sending this command to theReceptionist.ref.Multiple registrations can be made for the same key. De-registration is implied by the end of the referenced Actor’s lifecycle, but it can also be explicitly deregistered before termination.
-
register
public static <T> Receptionist.Command register(ServiceKey<T> key, ActorRef<T> service, ActorRef<Receptionist.Registered> replyTo) Java API: ARegistermessage with Ack that the service was registered. Associate the givenpekko.actor.typed.ActorRefwith the givenServiceKeyby sending this command to theReceptionist.ref.Multiple registrations can be made for the same key. De-registration is implied by the end of the referenced Actor’s lifecycle, but it can also be explicitly deregistered before termination.
Registration will be acknowledged with the
Receptionist.Registeredmessage to the given replyTo actor. -
registered
public static <T> Receptionist.Registered registered(ServiceKey<T> key, ActorRef<T> serviceInstance) Java API: Sent by the receptionist, available here for easier testing -
deregister
Java API: A Deregister message without Ack that the service was unregistered -
deregister
public static <T> Receptionist.Command deregister(ServiceKey<T> key, ActorRef<T> service, ActorRef<Receptionist.Deregistered> replyTo) Java API: A Deregister message with an actor that will get an ack that the service was unregistered -
deregistered
public static <T> Receptionist.Deregistered deregistered(ServiceKey<T> key, ActorRef<T> serviceInstance) Java API: Sent by the receptionist, available here for easier testing -
subscribe
public static <T> Receptionist.Command subscribe(ServiceKey<T> key, ActorRef<Receptionist.Listing> subscriber) Java API:Subscribemessage. The given actor to service updates when this command is sent to theReceptionist.ref. When the set of instances registered for the given key changes the subscriber will be sent aReceptionist.Listingwith the new set of instances for that service.The subscription will be acknowledged by sending out a first
Receptionist.Listing. The subscription automatically ends with the termination of the subscriber. -
find
public static <T> Receptionist.Command find(ServiceKey<T> key, ActorRef<Receptionist.Listing> replyTo) Java API:Findmessage. Query the Receptionist for a list of all Actors implementing the given protocol at one point in time by sending this command to theReceptionist.ref. -
listing
public static <T> Receptionist.Listing listing(ServiceKey<T> key, Set<ActorRef<T>> serviceInstances) Java API: Sent by the receptionist, available here for easier testing -
listing
public static <T> Receptionist.Listing listing(ServiceKey<T> key, Set<ActorRef<T>> serviceInstances, Set<ActorRef<T>> allServiceInstances, boolean servicesWereAddedOrRemoved) Java API: Sent by the receptionist, available here for easier testing -
apply
-
hashCode
public static final int hashCode() -
equals
-
id
-
ref
-