Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

io::async::loop::poll(3pm) [debian man page]

IO::Async::Loop::Poll(3pm)				User Contributed Perl Documentation				IO::Async::Loop::Poll(3pm)

NAME
"IO::Async::Loop::Poll" - use "IO::Async" with "poll(2)" SYNOPSIS
Normally an instance of this class would not be directly constructed by a program. It may however, be useful for runinng IO::Async with an existing program already using an "IO::Poll" object. use IO::Poll; use IO::Async::Loop::Poll; my $poll = IO::Poll->new; my $loop = IO::Async::Loop::Poll->new( poll => $poll ); $loop->add( ... ); while(1) { my $timeout = ... my $ret = $poll->poll( $timeout ); $loop->post_poll; } DESCRIPTION
This subclass of "IO::Async::Loop" uses an "IO::Poll" object to perform read-ready and write-ready tests. To integrate with existing code that uses an "IO::Poll", a "post_poll" can be called immediately after the "poll" method on the contained "IO::Poll" object. The appropriate mask bits are maintained on the "IO::Poll" object when notifiers are added or removed from the set, or when they change their "want_writeready" status. The "post_poll" method inspects the result bits and invokes the "on_read_ready" or "on_write_ready" methods on the notifiers. CONSTRUCTOR
$loop = IO::Async::Loop::Poll->new( %args ) This function returns a new instance of a "IO::Async::Loop::Poll" object. It takes the following named arguments: "poll" The "IO::Poll" object to use for notification. Optional; if a value is not given, a new "IO::Poll" object will be constructed. METHODS
$count = $loop->post_poll( $poll ) This method checks the returned event list from a "IO::Poll::poll" call, and calls any of the notification methods or callbacks that are appropriate. It returns the total number of callbacks that were invoked; that is, the total number of "on_read_ready" and "on_write_ready" callbacks for "watch_io", and "watch_time" event callbacks. $poll Reference to the "IO::Poll" object $count = $loop->loop_once( $timeout ) This method calls the "poll" method on the stored "IO::Poll" object, passing in the value of $timeout, and then runs the "post_poll" method on itself. It returns the total number of callbacks invoked by the "post_poll" method, or "undef" if the underlying "poll" method returned an error. AUTHOR
Paul Evans <leonerd@leonerd.org.uk> perl v5.14.2 2012-10-24 IO::Async::Loop::Poll(3pm)

Check Out this Related Man Page

IO::Poll(3pm)						 Perl Programmers Reference Guide					     IO::Poll(3pm)

NAME
IO::Poll - Object interface to system poll call SYNOPSIS
use IO::Poll qw(POLLRDNORM POLLWRNORM POLLIN POLLHUP); $poll = IO::Poll->new(); $poll->mask($input_handle => POLLIN); $poll->mask($output_handle => POLLOUT); $poll->poll($timeout); $ev = $poll->events($input); DESCRIPTION
"IO::Poll" is a simple interface to the system level poll routine. METHODS
mask ( IO [, EVENT_MASK ] ) If EVENT_MASK is given, then, if EVENT_MASK is non-zero, IO is added to the list of file descriptors and the next call to poll will check for any event specified in EVENT_MASK. If EVENT_MASK is zero then IO will be removed from the list of file descriptors. If EVENT_MASK is not given then the return value will be the current event mask value for IO. poll ( [ TIMEOUT ] ) Call the system level poll routine. If TIMEOUT is not specified then the call will block. Returns the number of handles which had events happen, or -1 on error. events ( IO ) Returns the event mask which represents the events that happened on IO during the last call to "poll". remove ( IO ) Remove IO from the list of file descriptors for the next poll. handles( [ EVENT_MASK ] ) Returns a list of handles. If EVENT_MASK is not given then a list of all handles known will be returned. If EVENT_MASK is given then a list of handles will be returned which had one of the events specified by EVENT_MASK happen during the last call ti "poll" SEE ALSO
poll(2), IO::Handle, IO::Select AUTHOR
Graham Barr. Currently maintained by the Perl Porters. Please report all bugs to <perlbug@perl.org>. COPYRIGHT
Copyright (c) 1997-8 Graham Barr <gbarr@pobox.com>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.2 2012-10-11 IO::Poll(3pm)
Man Page