AnyEvent::HandleNon-blocking I/O on file handles via AnyEvent | |
Download |
AnyEvent::Handle Ranking & Summary
Advertisement
- License:
- Perl Artistic License
- Price:
- FREE
- Publisher Name:
- Marc Lehmann
- Publisher web site:
- http://www.goof.com/pcg/marc/
AnyEvent::Handle Tags
AnyEvent::Handle Description
Non-blocking I/O on file handles via AnyEvent AnyEvent::Handle is a Perl class designed as a helper module to make it easier to do event-based I/O on filehandles. For utility functions for doing non-blocking connects and accepts on sockets see AnyEvent::Util. The AnyEvent::Intro tutorial contains some well-documented AnyEvent::Handle examples. In the following, when the documentation refers to of "bytes" then this means characters. As sysread and syswrite are used for all I/O, their treatment of characters applies to this module as well. All callbacks will be invoked with the handle object as their first argument.SYNOPSIS use AnyEvent; use AnyEvent::Handle; my $cv = AnyEvent->condvar; my $handle = AnyEvent::Handle->new ( fh => *STDIN, on_eof => sub { $cv->send; }, ); # send some request line $handle->push_write ("getinfo1512"); # read the response line $handle->push_read (line => sub { my ($handle, $line) = @_; warn "read line < $line > "; $cv->send; }); $cv->recv; Requirements: · Perl
AnyEvent::Handle Related Software