# Is it possible to dynamically run code inside actor/global actor?

**URL:** <https://forums.swift.org/t/is-it-possible-to-dynamically-run-code-inside-actor-global-actor/70599>\
**Category:** Using Swift\
**Created:** [March 12, 2024, 10:13am UTC](https://forums.swift.org/t/is-it-possible-to-dynamically-run-code-inside-actor-global-actor/70599 "2024-03-12T10:13:38Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ktoso](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/ktoso/32/44526_2.png) [@ktoso](https://forums.swift.org/u/ktoso)\
**Post date:** [March 12, 2024, 10:29am UTC](https://forums.swift.org/t/is-it-possible-to-dynamically-run-code-inside-actor-global-actor/70599/2 "2024-03-12T10:29:13Z")

</div>

The question is rather terse... so it's hard to know what exactly you mean.

Recovering static isolation information from dynamic in a synchronous function is done by `assumeIsolated`: [swift-evolution/proposals/0392-custom-actor-executors.md at main · apple/swift-evolution · GitHub](https://github.com/apple/swift-evolution/blob/main/proposals/0392-custom-actor-executors.md#assuming-actor-executors)

Otherwise, just write a function on the actor and call it.

There's soon going to be ways to "start Task on an actor" [`@isolated(any)` function types](https://forums.swift.org/t/isolated-any-function-types/70562/) if that's your question.

---

_[View the full topic](https://forums.swift.org/t/is-it-possible-to-dynamically-run-code-inside-actor-global-actor/70599)._
