I don't think it's possible to do directly right now, because of how the default executor works in swift. According the the WWDC2021 video that goes into detail about the internals, the default executor has nothing to do with GCD and is implemented from scratch with a similar "cooperative thread pool" approach as GCD, but optimized for Swift concurrency. The whole concept of "targeting an executor" concept is thrown away, because Swift's executor is essentially a singleton, where GCD provides a composable abstraction in the form of a queue. Considering that GCD is not extensible (e.g. doesn't allow you to define your own implementation of a queue), you can't even implement a new type of queue that schedules the blocks on the actor's mailbox.
When the "custom executor" proposal is implemented, you'd be able to customize the executor of the
LogicActor to use your a dedicated dispatch queue instead of the default executor, which you would then be able to use in GCD-dependent APIs as you've described.
For now, without doing it directly, one way I could think of would be to create an
UnsafeSendable class with the queue and wrap it inside an actor, which would forward all its method calls to the underlying class. This way you could use the wrapper actor as a
@globalActor and essentially ignore its internal mailbox in favor of your own
Yes, this looks ugly and tedious, but without custom executors, this is the only way that I can think of how you could accomplish what you want.