Required Instance Propertyswift 6.0.1Distributed
actorSystem
The DistributedActorSystem
that is managing this distributed actor.
- iOS
- 16.0+
- macOS
- 13.0+
- tvOS
- 16.0+
- watchOS
- 9.0+
nonisolated var actorSystem: Self.ActorSystem { get }
It is immutable and equal to the system assigned during the distributed actor’s local initializer (or to the system passed to the resolve(id:using:)
static function).
Synthesized property
In concrete distributed actor declarations, a witness for this protocol requirement is synthesized by the compiler.
It is required to assign an initial value to the actorSystem
property inside a distributed actor’s designated initializer. Semantically, it can be treated as a let
declaration, that must be assigned in order to fully-initialize the instance.
If a distributed actor declares no initializer, its default initializer will take the shape of init(actorSystem:)
, and initialize this property using the passed DistributedActorSystem
. If any user-defined initializer exists, the default initializer is not synthesized, and all the user-defined initializers must take care to initialize this property.
Other requirements
Type members
associatedtype ActorSystem
The type of transport used to communicate with actors of this type.
associatedtype SerializationRequirement
The serialization requirement to apply to all distributed declarations inside the actor.
static func resolve(id: Self.ID, using: Self.ActorSystem
) throws -> Self Resolves the passed in
id
against thesystem
, returning either a local or remote actor reference.
Instance members
nonisolated var id: Self.ID
Logical identity of this distributed actor.
nonisolated var unownedExecutor: UnownedSerialExecutor
Retrieve the executor for this distributed actor as an optimized, unowned reference. This API is equivalent to
unownedExecutor
, however, by default, it intentionally returnsnil
if this actor is a reference to a remote distributed actor, because the executor for remote references is effectively never g