IOMux::Alternatives - compare the IOMux implementation with other Event modules
On CPAN, you can find various alternatives for this module. Probably, this is caused by the very low level of programming help that the basic select() and poll() operating system calls offer. Various corners of a program need to register event listeners and later get events back. This requires some administration.
select()
poll()
The IOMux module started as a major rework of IO::Multiplex. It follows the same concept, but with major internal and visible improvements. Most methods with a name like mux* originate from IO::Multiplex function mux_*.
mux*
IO::Multiplex
mux_*
The IOMux implementation is conceptually much closer to IO::Multiplex (Plex) than you may expect. Similar enough to write a comparison.
Main differences:
In Plex, all is organized around a select loop. In Mux, you have a choice between various mechanisms of which some still need to be implemented.
select
In Plex, any file-handle may have a callback object associated to it. If not, some default is used. In IOMux, the callback object has the focus and has a file-handle associated to it. This should simplify more complex implementations.
IOMux does not support callbacks to name-spaces, because the object is used for per-handle administration. In Plex, that administration is located inside the multiplex main object (and therefore difficult to extend with higher level applications)
The Mux implementation defines the same mux_* methods as Plex, but has organized them. In Plex, the connection accepting mux_connection and the input callback mux_input are always available, even though a callback object probably supports only one of both. In IOMux, there is a clear distinction between various kinds of handlers.
mux_connection
mux_input
In Mux, you have a few more locations where you can hook the process, a few more callbacks.
Mux added official support for file reading and writing, pipes and more. Some of those do work in Plex as well, with some tricks.
Paul Evans has developed a large number of modules which is more feature complete than IOMux. It supports far more event loops, is better tested, and has many higher level applications ready to be used.
IOMux
Certain applications will benefit from IOMux (especially my personal development projects), because it is based on the OODoc module for object oriented perl module documentation, and Log::Report for error handling and translations.
This module is part of IOMux distribution version 1.01, built on January 15, 2020. Website: http://perl.overmeer.net/CPAN
Copyrights 2011-2020 by [Mark Overmeer <markov@cpan.org>]. 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://dev.perl.org/licenses/
To install IOMux, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IOMux
CPAN shell
perl -MCPAN -e shell install IOMux
For more information on module installation, please visit the detailed CPAN module installation guide.