Skip Menu |

This queue is for tickets about the Mojo-IOLoop-ProcBackground CPAN distribution.

Report information
The Basics
Id: 103197
Status: new
Priority: 0/
Queue: Mojo-IOLoop-ProcBackground

People
Owner: BPMEDLEY [...] cpan.org
Requestors: CYGA [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.04
Fixed in: (no value)



Subject: emit_safe was replaced with emit in Mojo
Since Mojolicious 5.40, emit_safe has been replaced by emit, which is now safe by default. emit_safe will be removed in Mojolicious 6. I see in latest version emit_safe calls. I tested variant s/emit_safe/emit/g - it worked for me.
On Mon Mar 30 06:36:23 2015, CYGA wrote: Show quoted text
> Since Mojolicious 5.40, emit_safe has been replaced by emit, which is > now safe by default. emit_safe will be removed in Mojolicious 6. > > I see in latest version emit_safe calls. > > I tested variant s/emit_safe/emit/g - it worked for me.
Attached diff for safe variant for all mojo versions.
Subject: fix.patch
--- lib/Mojo/IOLoop/ProcBackground.pm 2015-03-30 16:41:49.284733750 +0600 +++ lib/Mojo/IOLoop/ProcBackground.pm.OLD 2015-03-30 16:42:15.084735024 +0600 @@ -126,11 +126,11 @@ my $self = shift; Mojo::IOLoop->recurring(0.05 => sub { if ($self->proc->alive) { - $self->can('emit_safe') ? $self->emit_safe("alive") : $self->emit("alive"); + $self->emit_safe("alive"); } else { Mojo::IOLoop->remove($self->recurring); - $self->can('emit_safe') ? $self->emit_safe("dead") : $self->emit("dead"); + $self->emit_safe("dead"); } }); };