EV-Gearman
view release on metacpan or search on metacpan
Per-request timeout. The request at the head of the pending queue is
given this many ms from the moment it is written to the socket; if it
is still unanswered when its budget expires, the connection is torn
down with `"command timeout"`. The budget is independent of
unrelated traffic: other packets arriving meanwhile neither extend
the head request's budget nor shorten it, and once the head is
answered the next request's own budget applies. A slow reply that
keeps dribbling in is therefore safe as long as the request completes
within its budget â and a genuinely stuck request dies on schedule
even on an otherwise busy connection. `0` = no timeout (default).
### Reconnect
- `reconnect => $bool`
Enable automatic reconnect on transport errors.
- `reconnect_delay => $ms`
Wait this many ms before each reconnect attempt. Default `1000`.
lib/EV/Gearman.pm view on Meta::CPAN
Per-request timeout. The request at the head of the pending queue is
given this many ms from the moment it is written to the socket; if it
is still unanswered when its budget expires, the connection is torn
down with C<"command timeout">. The budget is independent of
unrelated traffic: other packets arriving meanwhile neither extend
the head request's budget nor shorten it, and once the head is
answered the next request's own budget applies. A slow reply that
keeps dribbling in is therefore safe as long as the request completes
within its budget â and a genuinely stuck request dies on schedule
even on an otherwise busy connection. C<0> = no timeout (default).
=back
=head3 Reconnect
=over
=item C<reconnect =E<gt> $bool>
Enable automatic reconnect on transport errors.
src/EV__Gearman.xs view on Meta::CPAN
NULL, 0, r);
}
static void worker_send_pre_sleep(pTHX_ ev_gm_t *self) {
if (!self->connected) return;
if (self->worker_sleeping) return;
self->worker_sleeping = 1;
enqueue_packet(aTHX_ self, GM_CMD_PRE_SLEEP, NULL, 0, NULL);
}
/* Drive the worker loop forward: if active and not busy, GRAB. */
static void worker_continue(pTHX_ ev_gm_t *self) {
if (!self->worker_active || !self->connected) return;
if (self->worker_grab_inflight || self->worker_sleeping) return;
if (ngx_queue_empty(&self->functions)) return;
worker_send_grab(aTHX_ self);
}
/* ================================================================
* Connect-success path: re-register worker functions, drain queue
* ================================================================ */
( run in 1.741 second using v1.01-cache-2.11-cpan-0fb53d1c279 )