Stream that acts as a reducer to build a data-structure that represents a state for my domain model over time ( think Stream.scan ). When clients request data over websocket, i have to query this data-structure to return results. I'm currently not sure how to proceed beyond exposing the value within the stream into a mutable variable and then run the http/websocket logic outside effect which references that variable.Ref and then emit events as needed from the source Stream, but I don't have sufficient fluency with the library to figure out how exactly to structure that.