Jeff Lockhart
07/08/2023, 8:40 PMCoroutineDispatcher
? I'm trying to create a mapping to dispatch_queue_t on iOS, similar to asExecutor on the JVM. Since dispatch_queue_t
is an opaque type, it's not possible to implement something like DispatcherExecutor. While it would be possible to wrap a dispatch_queue_t
as a CoroutineDispatcher
, I need to support the reverse, where a user provides a CoroutineDispatcher
in common Kotlin code and I use that dispatcher as a dispatch_queue_t
calling a native API in iOS platform code.Jeff Lockhart
07/08/2023, 8:42 PMdispatch_queue_create
to create a dispatch_queue_serial_t
, assuming the dispatcher has a parallelism of 1, since I can't differentiate between serial and concurrent dispatchers definitively.Jeff Lockhart
07/08/2023, 8:43 PMDispatchers.Main
should use dispatch_get_main_queue
of course.