spring-projects / spring-framework

Spring Framework
https://spring.io/projects/spring-framework
Apache License 2.0
56.75k stars 38.15k forks source link

Add coroutine extensions for RowsFetchSpec in Spring WebFlux #33854

Closed Yaklede closed 2 weeks ago

Yaklede commented 2 weeks ago

Hello Spring Team,

I’m excited to submit this contribution, which adds coroutine-friendly extensions to enhance Kotlin support within Spring WebFlux. Inspired by the challenges of adapting Mono and Flux types in coroutine-based projects, these additions aim to simplify and streamline asynchronous database operations for Kotlin developers. Thank you for the opportunity to contribute to such a valuable framework, and I look forward to your feedback!

Best regards

sdeleuze commented 2 weeks ago

Hi, thanks for this proposed contribution.

After reviewing it, I am not sure it is following the usual pattern we tend to adopt. As we already expose a flow() extension, I would suggest to use flow().toList() for such need.

Any thoughts?

Yaklede commented 2 weeks ago

Thank you for ur feedback! As you suggested, it seems correct to modify that part to use flow.toList(). I’ll make the adjustment!