Receptionist¶
casty.ServiceKey
dataclass
¶
casty.ServiceInstance
dataclass
¶
A single instance of a service in the cluster.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ref
|
ActorRef[M]
|
Reference to the actor providing the service. |
required |
node
|
NodeAddress
|
Node where the actor lives. |
required |
Examples:
casty.Listing
dataclass
¶
Current set of instances for a given service key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
ServiceKey[M]
|
The service key this listing is for. |
required |
instances
|
frozenset[ServiceInstance[M]]
|
All known instances of the service. |
required |
Examples:
casty.Register
dataclass
¶
Register a local actor as a service instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
ServiceKey[M]
|
Service key to register under. |
required |
ref
|
ActorRef[M]
|
Reference to the actor providing the service. |
required |
casty.Deregister
dataclass
¶
Remove a local actor from the service registry.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
ServiceKey[M]
|
Service key to deregister from. |
required |
ref
|
ActorRef[M]
|
Reference to the actor to remove. |
required |
casty.Subscribe
dataclass
¶
Subscribe to changes in a service key's instance set.
The subscriber immediately receives the current Listing and is
notified on every subsequent change.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
ServiceKey[M]
|
Service key to watch. |
required |
reply_to
|
ActorRef[Listing[M]]
|
Where to send |
required |
casty.Find
dataclass
¶
One-shot query for the current instances of a service key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
ServiceKey[M]
|
Service key to look up. |
required |
reply_to
|
ActorRef[Listing[M]]
|
Where to send the current |
required |