<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Distributed/DistributedActorSystem/remoteCall(on:target:invocation:throwing:returning:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Distributed"
    ],
    "preciseIdentifier" : "s:11Distributed0A11ActorSystemP10remoteCall2on6target10invocation8throwing9returningqd_1_qd___AA06RemoteE6TargetV17InvocationEncoderQzzqd_0_mqd_1_mtYaKAA0aB0Rd__s5ErrorRd_0_2IDQyd__0bP0Rtzr1_lF"
  },
  "title" : "remoteCall(on:target:invocation:throwing:returning:)"
}
-->

# remoteCall(on:target:invocation:throwing:returning:)

Invoked by the Swift runtime when making a remote call.

```
func remoteCall<Act, Err, Res>(on actor: Act, target: RemoteCallTarget, invocation: inout Self.InvocationEncoder, throwing: Err.Type, returning: Res.Type) async throws -> Res where Act : DistributedActor, Err : Error, Self.ActorID == Act.ID
```

## Discussion

The `arguments` are the arguments container that was previously created
by `makeInvocationEncoder` and has been populated with all arguments.

This method should perform the actual remote function call, and await for its response.

## Serialization Requirement

Implementations of this method must ensure that the `Argument` type parameter conforms
to the types’ `SerializationRequirement`.

## Errors

This method is allowed to throw because of underlying transport or serialization errors,
as well as by re-throwing the error received from the remote callee (if able to).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)