Subject: | on_finish, on_exception documentation error |
Hi :)
The documentation for IO::Async::Process suggests that the on_finish CODE is supplied with just the $exit_code as its argument[1] but invoke_event also passes a reference to our IO::Async::Process object,
from IO::Async::Notifier,
sub invoke_event
{
my $self = shift;
my ( $event_name, @args ) = @_;
my $code = $self->can_event( $event_name )
or croak "$self cannot handle $event_name event";
$self->_debug_printf_event( scalar caller, $event_name ) if $IO::Async::Debug::DEBUG;
return $code->( $self, @args );
}
I've hacked this on my local installation so that invoke_event
calls $code->( @args ); if the $event_name is 'on_finish' or 'on_exception'
and this seems to work.
Since other events seem to use the $self reference I imagine it may be that
the real error is just that the documentation has not been updated to match?
Thanks,
Richard Ipsum
[1] http://search.cpan.org/~pevans/IO-Async-0.67/lib/IO/Async/Process.pm#on_finish_$exitcode