ClassDistributed5.9.0
LocalTestingDistributedActorSystem
A DistributedActorSystem
designed for local only testing.
- iOS
- 16.0+
- macOS
- 13.0+
- tvOS
- 16.0+
- watchOS
- 9.0+
final class LocalTestingDistributedActorSystem
It will crash on any attempt of remote communication, but can be useful for learning about distributed actor
isolation, as well as early prototyping stages of development where a real system is not necessary yet.
Citizens in Distributed
Conformances
protocol DistributedActorSystem
A distributed actor system underpins and implements all functionality of distributed actors.
protocol Sendable
A type whose values can safely be passed across concurrency domains by copying.
Members
init(
) func actorReady<Act>(Act
) func assignID<Act>(Act
.Type) -> LocalTestingDistributedActorSystem.ActorID func makeInvocationEncoder(
) -> LocalTestingDistributedActorSystem.InvocationEncoder func remoteCall<Act, Err, Res>(on: Act, target: RemoteCallTarget, invocation: inout LocalTestingDistributedActorSystem.InvocationEncoder, throwing: Err.Type, returning: Res.Type
) async throws -> Res func remoteCallVoid<Act, Err>(on: Act, target: RemoteCallTarget, invocation: inout LocalTestingDistributedActorSystem.InvocationEncoder, throwing: Err.Type
) async throws func resignID(LocalTestingDistributedActorSystem
.ActorID) func resolve<Act>(id: LocalTestingDistributedActorSystem.ActorID, as: Act.Type
) throws -> Act? typealias ActorID
typealias InvocationDecoder
typealias InvocationEncoder
typealias ResultHandler
typealias SerializationRequirement
Features
func executeDistributedTarget<Act>(on: Act, target: RemoteCallTarget, invocationDecoder: inout Self.InvocationDecoder, handler: Self.ResultHandler
) async throws Prepare and execute a call to the distributed function identified by the passed arguments, on the passed
actor
, and collect its results using theResultHandler
.