# HG changeset patch # User Vincent Tondellier # Date 1407077134 -7200 # Node ID 2b158020f0d576f29465dbc9a6a0a21ea3596454 # Parent debc3c56699479d302b81753d1f994f759f6dd81 Revert to the non-async gearman client. I'm unable to make the AnyEvent client work with plack-based servers. Use gearman background jobs instead diff -r debc3c566994 -r 2b158020f0d5 lib/CrashTest/Decode/Queue/Gearman.pm --- a/lib/CrashTest/Decode/Queue/Gearman.pm Sat Aug 02 23:48:50 2014 +0200 +++ b/lib/CrashTest/Decode/Queue/Gearman.pm Sun Aug 03 16:45:34 2014 +0200 @@ -12,16 +12,13 @@ # along with this program. If not, see . package CrashTest::Decode::Queue::Gearman; - -use AnyEvent::Gearman::Client; - -use strict; -use warnings; +use Mojo::Base -strict; +use Gearman::Client; sub new { my ($class, $config, $dumperconfig, $storage) = @_; my $self = {}; - $self->{gearman} = AnyEvent::Gearman::Client->new(job_servers => $config->{GearmanServers}); + $self->{gearman} = Gearman::Client->new(job_servers => $config->{GearmanServers}); bless ($self, $class); return $self; } @@ -31,15 +28,9 @@ my $json = Mojo::JSON->new; my $args = $json->encode({ file => $file->slurp, params => $paramshash, uuid => $uuidstr }); - $self->{gearman}->add_task( - dump_decode => $args, - on_complete => sub { - my $taskres = $_[1]; - &$cb($json->decode($taskres)); - }, - on_fail => sub { - } - ); + $self->{gearman}->dispatch_background('dump_decode', $args); + + &$cb({ status => "backgrounded" }); } 1;