Flow support for Kotlin coroutines
See original GitHub issueHello,
I think it would be great to have something like this for coroutines
collection.find().toFlow()
There is consumeEach method in CoroutinePublisher, but I think Flow can be more powerful
Maybe something like this with closing resources on cancel
flow {
collection.find()
.consumeEach {
emit(it)
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Learn advanced coroutines with Kotlin Flow and LiveData
In this codelab, you'll learn how to use the LiveData builder to combine Kotlin coroutines with LiveData in an Android app.
Read more >Asynchronous Flow - Kotlin
The collection works directly in the coroutine that calls a terminal operator. No new coroutines are launched by default. Each emitted value is ......
Read more >Kotlin Coroutines Flow in a nutshell - ProAndroidDev
Each Flow chain consists of a specific set of operators. Each operator creates a new Flow instance but at the same time stores...
Read more >Going Reactive with Spring, Coroutines and Kotlin Flow
Kotlin was announced as an official Android development language at Google I/O 2017, we continued to improve the Kotlin support across Spring ...
Read more >Kotlin Flows and Coroutines - Roman Elizarov - Medium
Indeed, the design of Kotlin Flows is based on suspending functions and they are completely sequential, while a coroutine is an instance of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thank you for this PR! 😃 I will look at it soon. The <T:Any> is a common problem in kotlin because
Talone is equivalent toT:Any?. So:I suspect that KMongo is wrong here, I will investigate the problem when looking at your PR 😉
Hey
I opened a PR for that issue please check it out when you have time https://github.com/Litote/kmongo/pull/202
I don’t know how adding <T :Any> to all types will affect current clients of the library. For me it looks like anyway it’s impossible to create …Publisher with T?
So what do you think about that?