MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / stop_waiting

Function stop_waiting

lua/sp.c:463–480  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461}
462
463static int stop_waiting(Lua L, dbconsumer_t *q)
464{
465 if (check_retry_conditions(L, &q->info, 0) != 0)
466 return 1;
467 time_t now = time(NULL);
468 if (difftime(now, q->registration_time) <= 0) {
469 return 0;
470 }
471 SP sp = getsp(L);
472 if (sp->pingpong == 2) {
473 return 0;
474 }
475 if (luabb_trigger_register(L, &q->info, q->register_timeoutms) !=
476 CDB2_TRIG_REQ_SUCCESS)
477 return 1;
478 q->registration_time = time(NULL);
479 return 0;
480}
481
482static void ping(Lua L)
483{

Callers 2

pongFunction · 0.85
dbq_pollFunction · 0.85

Calls 3

check_retry_conditionsFunction · 0.85
difftimeFunction · 0.85
luabb_trigger_registerFunction · 0.85

Tested by

no test coverage detected