Closed snowdrop-bot closed 3 years ago
At the moment in Quarkus it is possible to use Mutiny Multi with the annotation @RestSseElementType to create an endpoint sending events to the client as they are created. Like so:
@RestSseElementType(MediaType.TEXT_PLAIN) fun doSse(): Multi<String> = Multi.createFrom(). emitter{ emitter -> emitter.emit("One") emitter.emit("Two") emitter.emit("Three") emitter.emit("Four") emitter.complete() }
Since Quarkus 2.0.0 it is possible to use Kotlin Coroutines with a suspend function for single request.
Support for Kotlin Flow for SSE would be a welcome addition. Something like the following code snippet:
@RestSseElementType(MediaType.TEXT_PLAIN) fun doFlow(): Flow<String> = flow{ emit("One") emit("Two") emit("Three") emit("Four") }
At the moment when using the above code the request returns immediately with a 200 but no values.
https://github.com/quarkusio/quarkus/issues/18201
$upstream:18201$
Description
At the moment in Quarkus it is possible to use Mutiny Multi with the annotation @RestSseElementType to create an endpoint sending events to the client as they are created. Like so:
Since Quarkus 2.0.0 it is possible to use Kotlin Coroutines with a suspend function for single request.
Support for Kotlin Flow for SSE would be a welcome addition. Something like the following code snippet:
At the moment when using the above code the request returns immediately with a 200 but no values.
https://github.com/quarkusio/quarkus/issues/18201
$upstream:18201$