NAME
IO::Mux::Poll - simplify use of poll()
INHERITANCE
IO::Mux::Poll
is a IO::Mux
SYNOPSIS
use IO::Mux::Poll;
my $mux = IO::Mux::Poll->new;
my $server = IO::Mux::Service::TCP->new(...);
$mux->add($server);
$mux->loop;
DESCRIPTION
Multiplexer based on the poll()
system call, defined by POSIX.
The poll
has less administration overhead than the select
call (implemented via IO::Mux::Select) because it avoids the need to play with bit-vectors to see which file handles got activated. However, poll
is not supported on all platforms.
METHODS
Constructors
- IO::Mux::Poll->new(OPTIONS) See "Constructors" in IO::Mux
Accessors
User interface
- $obj->add(HANDLER|BUNDLE) See "User interface" in IO::Mux
- $obj->endLoop(BOOLEAN) See "User interface" in IO::Mux
- $obj->loop([HEARTBEAT]) See "User interface" in IO::Mux
- $obj->open(MODE, PARAMS) See "User interface" in IO::Mux
For internal use
- $obj->changeTimeout(FILENO, OLDTIMEOUT, NEWTIMEOUT) See "For internal use" in IO::Mux
- $obj->fdset(FILENO, STATE, READ, WRITE, EXCEPT) See "For internal use" in IO::Mux
- $obj->handler(FILENO, [HANDLER]) See "For internal use" in IO::Mux
- $obj->handlers See "For internal use" in IO::Mux
- $obj->remove(FILENO) See "For internal use" in IO::Mux
DETAILS
Installation
Event managers
File handles
Alternatives
IO::Multiplex
Difference to IO::Multiplex
IO::Async / Net::Async
Implementation limitations
Poll is only available on UNIX. Windows Vista has added a WSAPoll with comparible functionality (probably), but afaik there is no binary wrapper available for perl yet.
SEE ALSO
This module is part of IO-Mux distribution version 0.11, built on January 26, 2011. Website: http://perl.overmeer.net/ All modules in this suite: "Any::Daemon", "IO::Mux", and "IO::Mux::HTTP".
Please post questions or ideas to perl@overmeer.net
LICENSE
Copyrights 2011 by Mark Overmeer. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html