develooper Front page | perl.perl5.porters | Postings from January 2012

[perl #108470] Term::ReadLine should use AE instead of Tk for event looping

From:
Father Chrysostomos via RT
Date:
January 31, 2012 09:34
Subject:
[perl #108470] Term::ReadLine should use AE instead of Tk for event looping
Message ID:
rt-3.6.HEAD-17313-1328031239-1395.108470-15-0@perl.org
On Tue Jan 31 03:03:45 2012, leonerd@leonerd.org.uk wrote:
> On Mon, Jan 30, 2012 at 03:23:43PM -0500, Rocco Caputo wrote:
> > That's a very sane idea.  It nicely sidesteps some maintenance
> > pitfalls, like having to explicitly list supported libraries and
> > optional dependencies.
> 
> +1
> 
> > >  my $ae_cb = sub {
> > >    my $cv = AE::cv;
> > >    AE::io($_[0]->in, 0, sub { $cv->send });
> > >    $cv->recv;
> > >  };
> > >  Term::ReadLine->new(..., read_callback => $ae_cb);
> 
> > That's kind of a weird and AE-specific way to do that callback.  A
> > more portable API would have two methods: One to access the library's
> > file handle, and another to be called when that handle is ready to be
> > read.
> 
> Yeah, I'd go with this. It's e.g. the same API that libtermkey uses to
> integrate with async. event loops:
> 
> 
>    int termkey_get_fd(TermKey *tk);
> 
>    /* call this when read() might succeed */
>    TermKeyResult termkey_advisereadable(TermKey *tk);
> 
> 
> Also I'd observe that if myself and Rocco agree on something
> async/eventy, it's likely a good consensus position :)

OK, then let me repeat my two questions:  Does anyone want to write a
patch for that?  Should I revert Darin McBride’s patch (b60dd40238)?


-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: resolved
https://rt.perl.org:443/rt3/Ticket/Display.html?id=108470



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About