Closed snowdrop-bot closed 3 years ago
Flow and Multi cannot be returned from a suspendable function (resteasy reactive).
Flow
Multi
No response
import io.smallrye.mutiny.Multi import io.smallrye.mutiny.coroutines.asMulti import kotlinx.coroutines.delay import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flow import javax.enterprise.context.ApplicationScoped import javax.ws.rs.GET import javax.ws.rs.Path import javax.ws.rs.Produces import javax.ws.rs.core.MediaType @ApplicationScoped @Path("/flow") class FlowResource { @GET @Path("/1") @Produces(MediaType.TEXT_PLAIN) suspend fun flow1Method(): Flow<String> { // kotlinx.coroutines.flow.SafeFlow@6b336f3a compute() return flow { emit("1") emit("2") emit("3") } } @GET @Path("/2") @Produces(MediaType.TEXT_PLAIN) suspend fun multiMethod(): Multi<String> { // io.smallrye.mutiny.operators.multi.builders.EmitterBasedMulti@5eec36c2 compute() return flow { emit("1") emit("2") emit("3") }.asMulti() } private suspend fun compute() { delay(1000) } }
uname -a
ver
java -version
Java 11
2.2.3.Final
mvnw --version
gradlew --version
Maven 3.8.1
https://github.com/quarkusio/quarkus/issues/20345
$upstream:20345$
Describe the bug
Flow
andMulti
cannot be returned from a suspendable function (resteasy reactive).Expected behavior
No response
Actual behavior
No response
How to Reproduce?
Output of
uname -a
orver
No response
Output of
java -version
Java 11
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.2.3.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Maven 3.8.1
Additional information
No response
https://github.com/quarkusio/quarkus/issues/20345
$upstream:20345$