As a complement of Coroutines extensions, for the sake of parity with the Reactor and RxJava support and because Coroutines allow to leverage Reactive infrastructure in a more imperative way, and for consistency with Spring WebFlux which provides both functional and annotation variants, I think it would be great if Spring Data could support Coroutines repositories.
With he recently released Flow type, it is now possible to provide such API that I have drafted:
Notice that Spring Framework 5.2 ReactiveAdapterRegistry supports Flow <-> Publisher adaptation, that MethodParameter is now Coroutines compliant, and that Spring Framework is able to adapt suspending functions to Mono even if this is not exposed yet (we could expose it for Spring Data needs).
Based on what we did on Framework side, it seems possible to implement Coroutines repositories like RxJava ones and consider it as an alternative API that we adapt to leverage our Reactive infrastructure.
Such API would be very popular I think.
Issue Links:
DATACMNS-1608 Support Kotlin's Flow
("is duplicated by")
DATACMNS-949 Drop own Converters and use ReactiveAdapterRegistry directly where possible
We discussed in our team how to proceed with this item and came to the conclusion that we want to move Coroutine repositories to our next release train. The main reason is that we need to consider how to package repositories as a Coroutine repository is no longer a pure extension. It's a class that will be visible to Java users.
This is one of the many reasons why we consider splitting up Spring Data Commons into multiple submodules (e.g. web part, repository part for Java and repository for Kotlin).
Given that we have only 6 weeks until we hit RC1 this is not feasible to achieve that goal within the remaining timeframe
Ok thanks for your feedback. Please ping me when you will start working on that, I would like to discuss with you how we could expose Spring Framework CoroutinesUtils class for external usage like this Spring Data use case
Sébastien Deleuze opened DATACMNS-1508 and commented
As a complement of Coroutines extensions, for the sake of parity with the Reactor and RxJava support and because Coroutines allow to leverage Reactive infrastructure in a more imperative way, and for consistency with Spring WebFlux which provides both functional and annotation variants, I think it would be great if Spring Data could support Coroutines repositories.
With he recently released Flow type, it is now possible to provide such API that I have drafted:
Notice that Spring Framework 5.2
ReactiveAdapterRegistry
supportsFlow
<->Publisher
adaptation, thatMethodParameter
is now Coroutines compliant, and that Spring Framework is able to adapt suspending functions toMono
even if this is not exposed yet (we could expose it for Spring Data needs).Based on what we did on Framework side, it seems possible to implement Coroutines repositories like RxJava ones and consider it as an alternative API that we adapt to leverage our Reactive infrastructure.
Such API would be very popular I think.
Issue Links:
("is duplicated by")
Referenced from: pull request #415
4 votes, 5 watchers
The text was updated successfully, but these errors were encountered: