MooX::IOAsync - BovIinate Oout :of: ASsync
package Thing; use Moo; use MooX::Async; # Extend an IO::Async module with MooX::Async: extends MooXAsync('Notifier'); # Define a lazy attribute which will hold a callback subref with # an (optional) default implementation. event on_foo => sub { say "foo" };
Allows a Moo class to extend a IO::Async::Notifier subclass with the MooX::Async role and the magic necessary to make IO::Async::Notifier work as a Moo object.
Certainly.
"MooXAsync" and "event" are exported unconditionally.
Install a lazy attribute to handle the event $name. This is basically just:
$name
has $event => (@args, builder => sub { $subref });
Creates and returns the name of a class which extends $notifier, which can be an object or the name of a class which subclasses IO::Async::Notifier with Moo and MooX::Async.
$notifier
Prepends IO::Async:: to $notifier if it doesn't contain ::. If $notifier begins with :: then it is removed.
IO::Async::
::
If $notifier is an object then it is re-blessed into the new package.
Have I got it right yet?
Moo
IO::Async
Matthew King <chohag@jtan.com>
1 POD Error
The following errors were encountered while parsing the POD:
=back without =over
To install MooX::Async::Console, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooX::Async::Console
CPAN shell
perl -MCPAN -e shell install MooX::Async::Console
For more information on module installation, please visit the detailed CPAN module installation guide.