Re: [Caml-list] ocamlnet: event queues

2010-11-06 Thread Jake Donham
On Sat, Nov 6, 2010 at 3:43 PM, Philippe Strauss  wrote:

> still in my first cut at rpc, in my app I need to react on a file
> descriptor collectings logs for a child process, how do I transform
>
>let esys = Unixqueue.standard_event_system () in

   [...]

   Unixqueue.run esys
>
> to something where I can add an fd to the poll/select, and know which fd
> has triggered one run of the loop?
>

If I understand you correctly, you just want to watch an additional file
descriptor and react when it becomes readable. You can do that by adding the
fd to the event system with Unixqueue.add_resource, then attaching a handler
for when the fd becomes readable with Unixqueue.add_handler. See the docs at


http://projects.camlcity.org/projects/dl/ocamlnet-3.0.2/doc/html-main/Unixqueue.html

for more details.

Jake
___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


[Caml-list] ocamlnet: event queues

2010-11-06 Thread Philippe Strauss

Hello,

still in my first cut at rpc, in my app I need to react on a file 
descriptor collectings logs for a child process, how do I transform


let esys = Unixqueue.standard_event_system () in
let server = Deconv_srv.Rpc_control.V1.create_server
~proc_connect: connect
~proc_set_input: set_input
~proc_set_deconvolution: set_deconvolution
(Rpc_server.Localhost 2345) Rpc.Tcp Rpc.Socket esys in
Unixqueue.run esys

to something where I can add an fd to the poll/select, and know which fd 
has triggered one run of the loop?
I did found Netsys_pollset.pollset.add fd browsing the doc, but writing 
a custom run() is another matter.



Thaaanks a lot.

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs