=for comment POD_DERIVED_INDEX_GENERATED
The following documentation is automatically generated.  Please do not edit
this file, but rather the original, inline with Process::Async::Worker
at lib/Process/Async/Worker.pm
(on the system that originally ran this).
If you do edit this file, and don't want your changes to be removed, make
sure you change the first line.

=encoding utf8

=cut

=head1 NAME

Process::Async::Worker - base class for IO::Async::Loop-using subprocess

=head1 VERSION

version 0.003

=head1 DESCRIPTION

Provides the base class for a worker implementation.

=head1 METHODS

=head2 run

Subclasses must provide this method.

 sub run {
  my ($self, $loop) = @_;
  $self->send_command('started');
  $loop->add(my $ua = Net::Async::HTTP->new);
  $ua->GET('http://example.com')->get;
 }

=head2 stdio

Accessor for the STDIO L<IO::Async::Stream>.

=head2 on_stdio_read

Handler for incoming STDIN events.

By default, this extracts lines and dispatches the first word as C< cmd_$word >
method, if available, or calls L</on_command> if not found.

Subclasses should override this to provide custom behaviour.

=head2 _add_to_loop

Sets up an L<IO::Async::Stream> for STDIO when we're added to the event loop.

=head1 INHERITED METHODS

=over 4

=item L<IO::Async::Notifier>

L<add_child|IO::Async::Notifier/add_child>, L<adopt_future|IO::Async::Notifier/adopt_future>, L<can_event|IO::Async::Notifier/can_event>, L<children|IO::Async::Notifier/children>, L<configure|IO::Async::Notifier/configure>, L<configure_unknown|IO::Async::Notifier/configure_unknown>, L<debug_printf|IO::Async::Notifier/debug_printf>, L<get_loop|IO::Async::Notifier/get_loop>, L<invoke_error|IO::Async::Notifier/invoke_error>, L<invoke_event|IO::Async::Notifier/invoke_event>, L<loop|IO::Async::Notifier/loop>, L<make_event_cb|IO::Async::Notifier/make_event_cb>, L<maybe_invoke_event|IO::Async::Notifier/maybe_invoke_event>, L<maybe_make_event_cb|IO::Async::Notifier/maybe_make_event_cb>, L<new|IO::Async::Notifier/new>, L<notifier_name|IO::Async::Notifier/notifier_name>, L<parent|IO::Async::Notifier/parent>, L<remove_child|IO::Async::Notifier/remove_child>, L<remove_from_parent|IO::Async::Notifier/remove_from_parent>

=back

=head1 AUTHOR

Tom Molesworth <cpan@perlsite.co.uk>

=head1 LICENSE

Copyright Tom Molesworth 2014-2015. Licensed under the same terms as Perl itself.
