* ocamlnet: event queues
@ 2010-11-06 22:43 Philippe Strauss
2010-11-07 4:01 ` [Caml-list] " Jake Donham
0 siblings, 1 reply; 2+ messages in thread
From: Philippe Strauss @ 2010-11-06 22:43 UTC (permalink / raw)
To: caml-list
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Caml-list] ocamlnet: event queues
2010-11-06 22:43 ocamlnet: event queues Philippe Strauss
@ 2010-11-07 4:01 ` Jake Donham
0 siblings, 0 replies; 2+ messages in thread
From: Jake Donham @ 2010-11-07 4:01 UTC (permalink / raw)
To: OCaml List
[-- Attachment #1: Type: text/plain, Size: 836 bytes --]
On Sat, Nov 6, 2010 at 3:43 PM, Philippe Strauss <philou@philou.ch> 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
[-- Attachment #2: Type: text/html, Size: 1520 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-11-07 4:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-06 22:43 ocamlnet: event queues Philippe Strauss
2010-11-07 4:01 ` [Caml-list] " Jake Donham
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox