Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
EdricChan03 opened this issue Aug 29, 2023 · 0 comments
Open

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

EdricChan03 opened this issue Aug 29, 2023 · 0 comments
Labels
affects:java Affects pure Java projects api request Request for a new API design API design enhancement New feature or request

Comments

@EdricChan03
Copy link
Owner

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
@EdricChan03 EdricChan03 added enhancement New feature or request api request Request for a new API affects:java Affects pure Java projects design API design labels Aug 29, 2023
@EdricChan03 EdricChan03 changed the title [All] Provide Java equivalent of Kotlin coroutines [All] Provide Java equivalent of Kotlin coroutines/Flows Aug 29, 2023
@EdricChan03 EdricChan03 changed the title [All] Provide Java equivalent of Kotlin coroutines/Flows [All] Provide Java equivalents of Kotlin coroutines/Flows Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:java Affects pure Java projects api request Request for a new API design API design enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant