https://kotlinlang.org logo
Title
r

Robert Jaros

10/08/2019, 5:42 PM
how to convert
Flux<T>
to
Channel<T>
?
z

zak.taccardi

10/08/2019, 5:43 PM
do you mean
Flow<T>
to
Flow<T>
?
r

Robert Jaros

10/08/2019, 5:45 PM
there is only the reverse function
ReceiveChannel.asFlux
z

zak.taccardi

10/08/2019, 5:45 PM
it doesn’t make sense to convert from flux to channel
if you need it, you are likely doing something wrong
r

Robert Jaros

10/08/2019, 5:46 PM
I have a websocket source which gives me Flux
z

zak.taccardi

10/08/2019, 5:46 PM
so have a websocket source which gives you a
Flow<T>
r

Robert Jaros

10/08/2019, 5:47 PM
I have a service wanting the data as Channel<T>
z

zak.taccardi

10/08/2019, 5:47 PM
unsubscribing from the websocket source should close it
this is what
Flow<T>
is for
the service is wrong then^^
r

Robert Jaros

10/08/2019, 5:47 PM
I would like to connect one to another 🙂
you can do that, but it’s bad
the service should be updated to consume a
Flow<T>
r

Robert Jaros

10/08/2019, 5:53 PM
I know it probably should
thx for help
👍 1