TechnologiesFoundation, System & Concurrency

Distributed

iOSmacOStvOSwatchOSvisionOS

Distributed provides Swift standard library support for distributed actors that communicate across process or network boundaries through pluggable actor systems. You declare an actor that conforms to DistributedActor and run it on a transport that conforms to DistributedActorSystem, which encodes and decodes remote calls using DistributedTargetInvocationEncoder, DistributedTargetInvocationDecoder, and DistributedTargetInvocationResultHandler to carry RemoteCallArgument values to a RemoteCallTarget. Failures surface through dedicated error types such as DistributedActorCodingError, DistributedActorSystemError, and ExecuteDistributedTargetError. For development and unit tests, LocalTestingDistributedActorSystem and its associated LocalTestingActorID, encoder, decoder, and result handler let you exercise distributed actors within a single process.

Distributed Actors 1

The core protocol for declaring actors whose methods can be invoked across process or network boundaries.

  • Pr
    DistributedActoriOS 16.0+
    Common protocol to which all distributed actors conform implicitly.

Actor Systems 1

The pluggable transport protocol that locates distributed actors and carries remote calls between them.

  • Pr
    DistributedActorSystemiOS 16.0+
    A distributed actor system underpins and implements all functionality of distributed actors.

Remote Call Invocation 5

Protocols and types that encode, decode, and dispatch the arguments and results of a remote distributed call.

  • Pr
    DistributedTargetInvocationEncoderiOS 16.0+
    Used to encode an invocation of a distributed target (method or computed property).
  • Pr
    DistributedTargetInvocationDecoderiOS 16.0+
    Decoder that must be provided to `executeDistributedTarget` and is used
  • Pr
    DistributedTargetInvocationResultHandleriOS 16.0+
    Protocol a distributed invocation execution's result handler.
  • St
    RemoteCallArgumentiOS 16.0+
    Represents an argument passed to a distributed call target.
  • St
    RemoteCallTargetiOS 16.0+
    Represents a 'target' of a distributed call, such as a `distributed func` or

Local Testing Actor System 5

An in-process actor system and its invocation machinery for exercising distributed actors in development and unit tests.

  • Cl
    LocalTestingDistributedActorSystemiOS 16.0+
    A `DistributedActorSystem` designed for local only testing.
  • St
    LocalTestingActorIDiOS 16.0+
    An identity that uniquely names a distributed actor within the local testing actor system.
  • St
    LocalTestingInvocationEncoderiOS 16.0+
    An invocation encoder that records the arguments of a distributed call for the local testing actor system.
  • Cl
    LocalTestingInvocationDecoderiOS 16.0+
    An invocation decoder that reads recorded arguments of a distributed call for the local testing actor system.
  • St
    LocalTestingInvocationResultHandleriOS 16.0+
    A result handler that returns the outcome of a distributed call for the local testing actor system.

Errors 4

Error protocols and types that report failures encountered while coding, executing, or transporting distributed calls.

  • Pr
    DistributedActorSystemErroriOS 16.0+
    Error protocol to which errors thrown by any `DistributedActorSystem` should conform.
  • St
    DistributedActorCodingErroriOS 16.0+
    Error thrown by distributed actor systems while encountering encoding/decoding
  • St
    ExecuteDistributedTargetErroriOS 16.0+
    Error thrown by ``DistributedActorSystem/executeDistributedTarget(on:target:invocationDecoder:handler:)``.
  • St
    LocalTestingDistributedActorSystemErroriOS 16.0+
    An error thrown by the local testing distributed actor system.

Type Aliases 1

  • Ty
    LocalTestingActorAddress

Extends 1

CodingUserInfoKey
← Foundation, System & Concurrency