Hopkins-Plugin-RPC
view release on metacpan or search on metacpan
lib/Hopkins/Plugin/RPC.pm view on Meta::CPAN
#
# post a DONE event to the soap session; this will
# cause a SOAP response to be sent back to the
# client.
$res->content({ success => 1 });
$kernel->post('rpc.soap' => DONE => $res);
} else {
# if the session wasn't found, we'll try to wait a
# bit for it to show up. if we exceed the maximum
# number of wait iterations, we'll return an error
# to the client.
if ($iter > HOPKINS_RPC_QUEUE_STATUS_WAIT_ITER_MAX) {
# exceeded maximum wait iterations; return an
# error to the client.
$res->content({ success => 0, err => "unable to start queue $name" });
$kernel->post('rpc.soap' => DONE => $res);
} else {
# else we'll go another round. set a kernel
# alarm for the appropriate time.
$kernel->alarm(queue_start_waitchk => time + HOPKINS_RPC_QUEUE_STATUS_WAIT_TIME, $res, $name, ++$iter);
}
lib/Hopkins/Plugin/RPC.pm view on Meta::CPAN
#
# post a DONE event to the soap session; this will
# cause a SOAP response to be sent back to the
# client.
$res->content({ success => 1 });
$kernel->post('rpc.soap' => DONE => $res);
} else {
# if the session was found, we'll try to wait a bit
# for it to be stopped. if we exceed the maximum
# number of wait iterations, we'll return an error
# to the client.
if ($iter > HOPKINS_RPC_QUEUE_STATUS_WAIT_ITER_MAX) {
# exceeded maximum wait iterations; return an
# error to the client.
$res->content({ success => 0, err => "unable to stop $name" });
$kernel->post('rpc.soap' => DONE => $res);
} else {
# else we'll go another round. set a kernel
# alarm for the appropriate time.
$kernel->alarm(queue_stop_waitchk => time + HOPKINS_RPC_QUEUE_STATUS_WAIT_TIME, $res, $name, ++$iter);
}
( run in 1.227 second using v1.01-cache-2.11-cpan-71847e10f99 )