Skip to content

Intend to contribute kotlinx-coroutines-servicetalk module #4537

@idelpivnitskiy

Description

@idelpivnitskiy

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:

  1. stCompletable, stSingle, stPublisher
  2. Job.asCompletable(), Deferred.asSingle(), Flow.asPublisher()
  3. io.servicetalk.concurrent.Executor.asCoroutineDispatcher()
  4. A set of await() methods for our Completable, Single, and Publisher
  5. Tests to ensure the conversion and context propagation work as expected
  6. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions