https://kotlinlang.org logo
#coroutines
Title
# coroutines
p

poohbar

10/19/2019, 8:30 PM
Sequences supply data on demand but in this case the producer is pushing the data. So I guess I might need a channel? 🤔
a

Adam Powell

10/19/2019, 9:02 PM
Sounds like a flow to me
j

Joe

10/19/2019, 9:20 PM
we have some codethat translates jetty websocket event callbacks to events on a channel: https://github.com/trib3/leakycauldron/blob/master/graphql/src/main/kotlin/com/trib3/graphql/websocket/GraphQLWebSocketAdapter.kt if you want to take a look -- there might be a good way to create a Flow instead, or you could do channel.consumeAsFlow() to consume as a Flow, but we just use the channel direclty
4 Views