SPR-15413: Add Kotlin coroutines for ListenableFuture#1375
Closed
konrad-kaminski wants to merge 1 commit intospring-projects:mainfrom
Closed
SPR-15413: Add Kotlin coroutines for ListenableFuture#1375konrad-kaminski wants to merge 1 commit intospring-projects:mainfrom
konrad-kaminski wants to merge 1 commit intospring-projects:mainfrom
Conversation
Prior to this commit there was no support for converting Kotlin
coroutines to/from ListenableFuture. Following that change a number of
functions will be available for such conversion.
Specifically these functions are introduced:
- // for converting suspending lambda to ListenableFuture
fun <T> listenableFuture(context: CoroutineContext = CommonPool,
block: suspend () -> T): ListenableFuture<T>
- // for converting Deffered into ListenableFuture
fun <T> Deferred<T>.asListenableFuture(): ListenableFuture<T>
- // for converting ListenableFuture into suspending function
suspend fun <T> ListenableFuture<T>.await(): T
Issue: SPR-15413
|
Just to have a reference to the issue https://jira.spring.io/browse/SPR-15413 |
Member
|
@sdeleuze can you please check if this is still applicable? |
Contributor
|
After team discussion, we have decided not to invest in Thank you for submitting a PR, though. |
Contributor
|
Also see #27780. |
Contributor
|
+1 for that decision. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prior to this commit there was no support for converting Kotlin
coroutines to/from ListenableFuture. Following that change a number of
functions will be available for such conversion.
Specifically these functions are introduced:
// for converting suspending lambda to ListenableFuture
fun <T> listenableFuture(context: CoroutineContext = CommonPool, block: suspend () -> T): ListenableFuture<T>// for converting Deffered into ListenableFuture
fun <T> Deferred<T>.asListenableFuture(): ListenableFuture<T>// for converting ListenableFuture into suspending function
suspend fun <T> ListenableFuture<T>.await(): TThe code in this PR draws heavily on the code from https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-jdk8/src/main/kotlin/kotlinx/coroutines/experimental/future/Future.kt. This is why Roman Elizarov is also an author.