From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 1C00DBC57 for ; Sun, 7 Nov 2010 05:02:12 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqgBAFrB1UzRVdi2kGdsb2JhbACZewGIBQgVAQEBAQkJDAcRAx+gXIt2hDaJBwEBAwWFQwSEWIV9iSQ X-IronPort-AV: E=Sophos;i="4.58,308,1286143200"; d="scan'208";a="77381537" Received: from mail-qy0-f182.google.com ([209.85.216.182]) by mail4-smtp-sop.national.inria.fr with ESMTP; 07 Nov 2010 05:02:11 +0100 Received: by qyk7 with SMTP id 7so3588310qyk.6 for ; Sat, 06 Nov 2010 21:02:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:content-type; bh=d3flSx9jALqyteeMGVqCbqksvMpRZDKpCRNu4+TFHqw=; b=PJo0vcJEK5RQ7plT05vCbNrLbYxMjj8fe0Q7F+pVeK4b7+/ZPQqIY0vjxvVu04P1g+ JKi4mdS8NhKQhl8c3djw3dHm4EyADA4iB5vzS+3cMgSUJi7crgwAnOdmahrrq6T+vzBX zxSFhvcOLuqM85CfrrsRUxCSXpl777GtX8qng= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; b=DIBf1zBPI4TjHuq9G5EWl/esN1/yT4eZbxGostQUiMiaHcmc1KUWnSKmx1aWD7WS4f qagOsW8y0Y8USEhpjYO71oEMO65c7UasgK/A+uEsbhkvBZmlbR1/R0ZSg/n7UqhvKHVd kNwsPenaBVKpFPoOAroICxEaPkHFZLpGdIXAQ= Received: by 10.229.224.136 with SMTP id io8mr3665353qcb.88.1289102528586; Sat, 06 Nov 2010 21:02:08 -0700 (PDT) MIME-Version: 1.0 Sender: jake.donham@gmail.com Received: by 10.229.66.88 with HTTP; Sat, 6 Nov 2010 21:01:48 -0700 (PDT) In-Reply-To: <4CD5D9F7.9050305@philou.ch> References: <4CD5D9F7.9050305@philou.ch> From: Jake Donham Date: Sat, 6 Nov 2010 21:01:48 -0700 X-Google-Sender-Auth: bEYZlmqiKsdkfkl4Nd6UcSq0aVA Message-ID: Subject: Re: [Caml-list] ocamlnet: event queues To: OCaml List Content-Type: multipart/alternative; boundary=0016364d2e314ba49c04946e9289 X-Spam: no; 0.00; ocamlnet:01 ocamlnet-:01 ocamlnet-:01 wrote:01 wrote:01 readable:01 readable:01 caml-list:01 descriptor:02 descriptor:02 handler:03 handler:03 let:03 let:03 correctly:04 --0016364d2e314ba49c04946e9289 Content-Type: text/plain; charset=ISO-8859-1 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 --0016364d2e314ba49c04946e9289 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Sat, Nov 6, 2010 at 3:43 PM, Philippe Strauss <philou@philou.ch> wrote:
<= div class=3D"gmail_quote">
still in my first cut at rpc, in my app I need to react on a file descripto= r collectings logs for a child process, how do I transform

=A0 =A0let esys =3D Unixqueue.standard_event_system () in=A0
<= blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px= #ccc solid;padding-left:1ex;">=A0=A0 [...]
=A0=A0 Unixqueue.run esys

to something where I can add an fd to the poll/select, and know which fd ha= s triggered one run of the loop?

If I u= nderstand you correctly, you just want to watch an additional file descript= or 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.

Jake

--0016364d2e314ba49c04946e9289--