MojoX::AIO - Asynchronous File I/O for Mojolicious
use Mojo::IOLoop; use MojoX::AIO; use Fcntl qw( O_RDONLY ); # use normal IO::AIO methods aio_open( '/etc/passwd', O_RDONLY, 0, sub { my $fh = shift; my $buffer = ''; aio_read( $fh, 0, 1024, $buffer, 0, sub { my $bytes = shift; warn "read bytes: $bytes data: $buffer\n"; Mojo::IOLoop->singleton->stop; }); }); Mojo::IOLoop->singleton->start;
This component adds support for L<IO::AIO> use with L<Mojolicious>
This module automaticly bootstraps itself on use. To disable this, use:
use MojoX::AIO { no_auto_bootstrap => 1 };
IO::AIO, Mojolicious (http://mojolicio.us/)
David Davis <xantus@cpan.org>, http://xantus.org/
Olivier Duclos
Artistic License
Copyright (c) 2010-2012 David Davis, All rights reserved
To install MojoX::AIO, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MojoX::AIO
CPAN shell
perl -MCPAN -e shell install MojoX::AIO
For more information on module installation, please visit the detailed CPAN module installation guide.