-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Use case
I'm a maintainer of ServiceTalk - a library that implements Reactive Streams Specification for the JVM and then uses it for our HTTP/gRPC implementations.
Our users are interested in trying to use Kotlinx.coroutines, but the lack of adapters is the main blocker for them.
Would you accept a contribution of a new module named kotlinx-coroutines-servicetalk
under your reactive folder from us?
The Shape of the API
Our reactive primitives are located here: https://github.com/apple/servicetalk/tree/main/servicetalk-concurrent. We follow RxJava style with Completable
, Single
, and Publisher
. Therefore, we will follow the pattern of kotlinx-coroutines-rx3 module to add:
stCompletable
,stSingle
,stPublisher
Job.asCompletable()
,Deferred.asSingle()
,Flow.asPublisher()
io.servicetalk.concurrent.Executor.asCoroutineDispatcher()
- A set of
await()
methods for ourCompletable
,Single
, andPublisher
- Tests to ensure the conversion and context propagation work as expected
- Reactive Streams TCK tests to ensure
stCompletable
,stSingle
,stPublisher
pass those
Motivation
I prototyped the implementation and realized that it requires me to use a lot of InternalCoroutinesApi
, ExperimentalCoroutinesApi
, and DelicateCoroutinesApi
and I can not access useful test-utils from your repo to ensure ordered execution in my tests. Instead of using all these APIs somewhere else, I'd be happy to contribute the adapters to your repo.
On our side, public API of servicetalk-concurrent module is stable. It hasn't changed in the past 6 years and we don't have plans to change it as it's critical for us to maintain backward compatibility.