DistributedSystem
DistributedSystem.swift:94class DistributedSystem
Citizens in DistributedSystem
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.
Types
Typealiases
typealias ActorID
typealias InvocationDecoder
typealias InvocationEncoder
typealias ResultHandler
typealias SerializationRequirement
typealias ServiceFactory
typealias ServiceFilter
Type members
init(name: String, addressTag: String?, compressionMode: CompressionMode, logLevel: Logger.Level
) init(systemName: String, addressTag: String?, compressionMode: CompressionMode, logLevel: Logger.Level
)
Instance members
let consulServiceDiscovery: ConsulServiceDiscovery
var logger: Logger
var loggerBox: Box<Logger>
let systemName: String
func actorReady<Actor>(Actor
) func assignID<Actor>(Actor.Type
) -> EndpointIdentifier func connectToService<S, C>(S.Type, withFilter: @escaping ServiceFilter, clientFactory: ((DistributedSystem) -> C)?, serviceHandler: ((S, ConsulServiceDiscovery.Instance) -> Void)?, deadline: DispatchTime?
) async throws -> S To be used to connect to a single service of the particular type. Function returns the service endpoint instance after connection to service is established and service endpoint is ready for use.
func connectToService<S>(S.Type, withFilter: @escaping ServiceFilter, serviceHandler: ((S, ConsulServiceDiscovery.Instance) -> Void)?, deadline: DispatchTime?
) async throws -> S To be used to connect to a single service of the particular type. Function returns the service endpoint instance after connection to service is established and service endpoint is ready for use.
func connectToServices<S, C>(S.Type, withFilter: @escaping ServiceFilter, clientFactory: ((DistributedSystem, ConsulServiceDiscovery.Instance) -> C)?, serviceHandler: @escaping (S, ConsulServiceDiscovery.Instance) -> Void, cancellationToken: CancellationToken?
) -> Bool To be used to connect to multiple services of the same type. Service will be discovered with using a discovery system (consul by default).
func getBytesSent(
) async throws -> UInt64 func makeCancellationToken(
) -> CancellationToken func makeInvocationEncoder(
) -> RemoteCallEncoder func remoteCall<Actor, Err, Res>(on: Actor, target: RemoteCallTarget, invocation: inout InvocationEncoder, throwing: Err.Type, returning: Res.Type
) async throws -> Res func remoteCallVoid<Actor, Err>(on: Actor, target: RemoteCallTarget, invocation: inout InvocationEncoder, throwing: Err.Type
) async throws func resignID(EndpointIdentifier
) func resolve<Actor>(id: EndpointIdentifier, as: Actor.Type
) throws -> Actor? func start(
) throws Service lifecycle start
func stop(
) Service lifecycle stop
Instance 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
.