Protocol_Concurrency5.9.0
AnyActor
Common marker protocol providing a shared “base” for both (local) Actor
and (potentially remote) DistributedActor
types.
- iOS
- 13.0+
- macOS
- 10.15+
- tvOS
- 13.0+
- watchOS
- 6.0+
protocol AnyActor : AnyObject, Sendable
The AnyActor
marker protocol generalizes over all actor types, including distributed ones. In practice, this protocol can be used to restrict protocols, or generic parameters to only be usable with actors, which provides the guarantee that calls may be safely made on instances of given type without worrying about the thread-safety of it – as they are guaranteed to follow the actor-style isolation semantics.
While both local and distributed actors are conceptually “actors”, there are some important isolation model differences between the two, which make it impossible for one to refine the other.
Supertypes
protocol Sendable
A type whose values can safely be passed across concurrency domains by copying.
Citizens in _Concurrency
Subtypes
protocol Actor
Common protocol to which all actors conform.
Available in Distributed
Subtypes
protocol DistributedActor
The such obtained actor system is then used to
resolve(id:using:)
the decodedID
.