Skip to content

[All] Provide Java equivalents of Kotlin coroutines/Flows #9

@EdricChan03

Description

@EdricChan03

See #8

Calling suspend functions is impossible from Java as the Continuation interface appears to expect a sealed class that has an internal Kotlin class

API suggestions

(Suggestions are tentative as of now)

For single-value suspend functions

We could expose methods that return one of the following:

Object Source Implementation
CompletableFuture Java 8+ CoroutineScope#future
ListenableFuture Guava CoroutineScope#future
Single RxJava 2.x rxSingle
Single RxJava 3.x rxSingle

For methods that return a Flow

We could expose methods that return one of the following:

Object Source Implementation
Flow.Publisher Java 9+ Flow.asPublisher
Flowable RxJava 2.x Flow.asFlowable
Flowable RxJava 3.x Flow.asFlowable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions