NAME

MooX::IOAsync - BovIinate Oout :of: ASsync

SYNOPSIS

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" };

DESCRIPTION

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.

BUGS

Certainly.

EXPORTS

"MooXAsync" and "event" are exported unconditionally.

event($name, [@args], [$subref]) => void

Install a lazy attribute to handle the event $name. This is basically just:

has $event => (@args, builder => sub { $subref });
MooXAsync($notifier) => $async_moo_class

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.

Prepends IO::Async:: to $notifier if it doesn't contain ::. If $notifier begins with :: then it is removed.

If $notifier is an object then it is re-blessed into the new package.

HISTORY

MooX::Async 0.004

Have I got it right yet?

SEE ALSO

Moo

IO::Async

AUTHOR

Matthew King <chohag@jtan.com>

1 POD Error

The following errors were encountered while parsing the POD:

Around line 116:

=back without =over