<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Distributed/buildDefaultDistributedRemoteActorExecutor(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Distributed"
    ],
    "preciseIdentifier" : "s:11Distributed012buildDefaultA19RemoteActorExecutoryScexAA0aE0RzlF"
  },
  "title" : "buildDefaultDistributedRemoteActorExecutor(_:)"
}
-->

# buildDefaultDistributedRemoteActorExecutor(_:)

Obtain the unowned `SerialExecutor` that is used by by remote distributed actor references.
The executor is shared between all remote default executor remote distributed actors,
and it will crash if any job is enqueued on it.

```
func buildDefaultDistributedRemoteActorExecutor<Act>(_ actor: Act) -> UnownedSerialExecutor where Act : DistributedActor
```

## Discussion

It is possible to obtain the executor e.g. for logging or general debugging,
however attempting to enqueue work on what might potentially be a remote actor
is a programming error and therefore will crash if the actor is potentially.

If one intends to use a distributed actor’s executor to schedule work on it,
one should programmatically ensure that that actor is local, e.g. using the `whenLocal`
functionality of distributed actors, or by other means (e.g. “knowing that it definitely must be local”)

---

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)