Handling TCP Socket Events with Effect and Stream.async

Is there a pattern to deal with something like a tcp socket? What I mean is I need to handle several events on the socket, including the data. For the data part, it seems like Stream.async() is the right construct. But for other events, should I be using Effect.async for each? If so, then it would appear I need somehow simultaneously yield for all of these event processing effects concurrently or in a race. Is this the right way to handle things? The other option is to wrap all the event handlers in a single Effect.async call, but then most of the code will be in 'non-effect' land, which also doesn't seem right
Was this page helpful?