MCPcopy Create free account
hub / github.com/defold/defold / Loop

Function Loop

engine/script/src/http_service.cpp:458–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456 }
457
458 static void Loop(void* arg)
459 {
460 Worker* worker = (Worker*) arg;
461
462 uint64_t flush_period = 5 * 1000000U;
463 uint64_t next_flush = dmTime::GetMonotonicTime() + flush_period;
464 while (worker->m_Run)
465 {
466 dmMessage::DispatchBlocking(worker->m_Socket, &Dispatch, worker);
467 if (!worker->m_Run)
468 break;
469
470 if (worker->m_CacheFlusher && dmTime::GetMonotonicTime() > next_flush) {
471 dmHttpCache::Flush(worker->m_Service->m_HttpCache);
472 next_flush = dmTime::GetMonotonicTime() + flush_period;
473 }
474 }
475 }
476
477 static void LoadBalancer(void* arg)
478 {

Callers

nothing calls this directly

Calls 3

DispatchBlockingFunction · 0.85
GetMonotonicTimeFunction · 0.50
FlushFunction · 0.50

Tested by

no test coverage detected