Skip to content
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

Support suspending functions returning Flow #22820

Closed
sdeleuze opened this issue Apr 19, 2019 · 0 comments
Closed

Support suspending functions returning Flow #22820

sdeleuze opened this issue Apr 19, 2019 · 0 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Milestone

Comments

@sdeleuze
Copy link
Contributor

sdeleuze commented Apr 19, 2019

WebFlux Coroutines support does not handle correctly suspending functions that returns Coroutines Flow which is a valid use case when for example using WebClient "2 stage" API.

@GetMapping("/flow-via-webclient")
suspend fun flowViaWebClient() =
		client.get()
			.uri("/flow")
			.accept(MediaType.APPLICATION_JSON)
			.awaitExchange()
			.bodyToFlow<Banner>()

This use case is valid and should be supported.

@sdeleuze sdeleuze added in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug labels Apr 19, 2019
@sdeleuze sdeleuze added this to the 5.2 M2 milestone Apr 19, 2019
@sdeleuze sdeleuze self-assigned this Apr 19, 2019
sdeleuze added a commit to sdeleuze/spring-framework that referenced this issue Apr 23, 2019
This commit leverages Flux instead of Flow to support suspending
handler methods returning Flow in order to avoid multiple invocations
of the suspending function on every collect().

See spring-projectsgh-22820
sdeleuze added a commit to sdeleuze/spring-framework that referenced this issue Apr 23, 2019
This commit leverages Flux instead of Flow to support suspending
handler methods returning Flow in order to avoid multiple invocations
of the suspending function on every collect().

See spring-projectsgh-22820
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant