On Thu, Sep 02, 2004 at 01:52:59PM +0100, Matt Sergeant wrote:
> On 1 Sep 2004, at 03:13, david nicol wrote:
> 
> >Based on this comment I would like to extend the proposed extension
> >to include an optional $h->fileno() method, which would return
> >an arrayref containing file descriptor numbers for use in the main
> >event loop, so a busy event-driven system will know when it can be sure
> >that calling $h->ready() will not waste cycles.
> >
> >   {
> >     my $htmp = $h;
> >     my $coderef = sub { $htmp->ready and push @Readies, $htmp };
> >     $Callback[$_] = $coderef for @{$h->fileno};
> >   }
> >
> >     ...
> >     buildselectvectors(@Listeners,@Clients,@Callbacks);
> >     select ...
> >
> >An array ref rather than one number, so handles that have multiple
> >connections open can report them all.
> 
> Yes, this would work. Having each DBD implement their own internal 
> select() wouldn't work as well, because two event loops are worse than 
> one.

I haven't had a chance to read through all the comments in this thread yet,
but I'll point out two flies in the ointment:

1. Many database API's don't offer access to the filehandle.

2. Even for those that do, just because the filehandle becomes 'readable'
   doesn't mean that the appropriate API function call won't block.

Tim.

Reply via email to