My usual approach for such kind of tasks is to have an `Lwt_stream.t` of messages, from all the connections. 
Then I use `Lwt_stream.fold` to literally fold my state over all messages. 

On Mon, May 4, 2015 at 12:26 PM, Daniil Baturin <daniil@baturin.org> wrote:
Hi all,

I'm trying to figure out how to handle concurrent connections with Lwt,
and I'm quite confused.

Suppose I'm writing an IRC server (actually I'm not, but connection
handling model will be similar).
I need to accept connections, read from descriptors, and update some state.

So far I've only found examples of handling HTTP-style requests (reply
and close).

What is the proper way to do this in Lwt? Are there any projects or code
examples I can learn from?

Thanks,
Daniil



--
Caml-list mailing list.  Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs