English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
ocamlnet: event queues
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-11-07 (04:02)
From: Jake Donham <jake@d...>
Subject: Re: [Caml-list] ocamlnet: event queues
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


for more details.