Archived
1
0

Can receive a process without XML format

This commit is contained in:
Mercier Pierre-Olivier 2013-09-24 01:48:53 +02:00
parent d346848b90
commit 488c2bbbb8

View File

@ -67,6 +67,26 @@ sub do_work ($$$@)
return $subref->($given_args, $args); return $subref->($given_args, $args);
} }
sub register_no_parse ($$;$)
{
my $funcname = shift;
my $subref = shift;
my $given_arg = shift;
my $worker = Gearman::Worker->new;
$worker->job_servers('gearmand:4730');
$worker->register_function($funcname => sub { return $subref->($given_arg, $_[0]{argref}); });
# Disable exit on warning or error
$ACU::Log::fatal_warn = 0;
$ACU::Log::fatal_error = 0;
log DEBUG, "$funcname registered";
$worker->work while 1;
}
sub register ($$;$$) sub register ($$;$$)
{ {
my $funcname = shift; my $funcname = shift;