https://kotlinlang.org logo
#coroutines
Title
# coroutines
a

Arkadii Ivanov

02/12/2020, 9:18 PM
Hello, I'm playing with a custom
CoroutineDispatcher
implementation using this implementation as a reference: https://github.com/Kotlin/kotlinx.coroutines/blob/master/reactive/kotlinx-coroutines-rx2/src/RxScheduler.kt However
Delay
interface is marked as
InternalCoroutinesApi
. Is there a good way to implement delaying?
1
l

louiscad

02/12/2020, 11:04 PM
If you really need to implement it, you can opt-in to use InternalCoroutinesApi, but you can also delegate delay to
Dispatchers.Default
a

Arkadii Ivanov

02/12/2020, 11:27 PM
IFAIK delay is delegated to the Default dispatcher by default. What I want to do is to implement it "natively". Looks like implementing an
InternalCoroutinesApi
is not a good idea, binary compatibility may be broken in future.
v

Vsevolod Tolstopyatov [JB]

02/17/2020, 9:28 AM
Indeed, it can be broken, though, unlikely. The main rationale behind being marked
Internal
— we are not happy with the current
Delay
API shape (methods, conctracts, implicity etc.), but neither have real-use cases nor time to properly design it. Reporting your use-case to the issues would be a great start
2 Views