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 30, 2012 12:46
Subject:
[perl #108470] Term::ReadLine should use AE instead of Tk for event looping
Message ID:
rt-3.6.HEAD-14510-1327956357-760.108470-15-0@perl.org
On Mon Jan 30 10:27:50 2012, mst@shadowcat.co.uk wrote:
> > Tk is not a hard dependency at the moment, unless you want an event
> loop.  AE
> > will not be a hard dependency (with my proposed patch), either.
> 
> So far as I can tell, ReadLine simply wants to know when a filehandle
> is
> readable.
> 
> So rather than adding yet another hard-coded piece of loop support
> (and one
> that as noted in my other message is unusable in some environments),
> perhaps
> we could simply add a callback interface - i.e.
> 
>   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);
> 
> Then we can document the AnyEvent way as an example, users of other
> event
> loops can do the same, and everybody gets what they want without
> introducing
> explicit core support for a module that's ... controvertial, at best.

Does anyone want to write a patch for that?  Should I revert Darin
McBride’s patch?

-- 

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