Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/grinnz/mojo-ioloop-subprocess-sereal

Mojo::IOLoop::Subprocess::Sereal - Subprocesses with Sereal
https://github.com/grinnz/mojo-ioloop-subprocess-sereal

Last synced: 5 days ago
JSON representation

Mojo::IOLoop::Subprocess::Sereal - Subprocesses with Sereal

Awesome Lists containing this project

README

        

=pod

=encoding utf8

=head1 NAME

Mojo::IOLoop::Subprocess::Sereal - Subprocesses with Sereal

=head1 SYNOPSIS

use Mojo::IOLoop::Subprocess::Sereal;

# Operation that would block the event loop for 5 seconds
my $subprocess = Mojo::IOLoop->$_subprocess(
sub {
my $subprocess = shift;
sleep 5;
return '♥', 'Mojolicious';
},
sub {
my ($subprocess, $err, @results) = @_;
say "I $results[0] $results[1]!";
}
);

# Start event loop if necessary
Mojo::IOLoop->start unless Mojo::IOLoop->is_running;

=head1 DESCRIPTION

L provides a L"$_subprocess"> method which
works as a drop-in replacement for L while using
L for data serialization. L is faster than L and
supports serialization of more reference types such as C. The
L is supported to control
serialization of blessed objects.

See L for a role to apply L
data serialization to any L.

=head1 EXPORTS

L exports the following variable by default.

=head2 $_subprocess

my $subprocess = Mojo::IOLoop->$_subprocess(sub {...}, sub {...});
my $subprocess = Mojo::IOLoop->$_subprocess;
my $subprocess = $loop->$_subprocess(sub {...}, sub {...});

Build L object to perform computationally expensive
operations in subprocesses, without blocking the event loop. Composes and calls
L to use L for
data serialization. If arguments are provided, they will be used to call
L.

=head1 BUGS

Report any issues on the public bugtracker.

=head1 AUTHOR

Dan Book

=head1 COPYRIGHT AND LICENSE

This software is Copyright (c) 2016 by Dan Book.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)

=head1 SEE ALSO

L, L, L

=cut