Required Instance Methodswift 6.1.2Distributed

actorReady(_:)

Invoked during a distributed actor’s initialization, as soon as it becomes fully initialized.

iOS
16.0+
macOS
13.0+
tvOS
16.0+
watchOS
9.0+
func actorReady<Act>(_ actor: Act) where Act : DistributedActor, Self.ActorID == Act.ID

Parameters

actor

reference to the (local) actor that was just fully initialized.

The system is expected to store the reference to this actor, and maintain an ActorID: DistributedActor mapping for the purpose of implementing the resolve(id:as:) method.

The system usually should NOT retain the passed reference, and it will be informed via resignID(_:) when the actor has been deallocated so it can remove the stale reference from its internal ActorID: DistributedActor mapping.

The id of the passed actor must be an ActorID that this system previously has assigned.

If actorReady gets called with some unknown ID, it should crash immediately as it signifies some very unexpected use of the system.