MCPcopy Create free account
hub / github.com/Tencent/phxqueue / DaemonThreadRun

Method DaemonThreadRun

phxqueue/producer/batchhelper.cpp:320–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

318
319
320void BatchHelper::DaemonThreadRun(int vtid) {
321 stCoRoutineAttr_t attr;
322 attr.stack_size = 1024 * impl_->process_routine_share_stack_size_kb;
323
324 auto process_ctxs = unique_ptr<struct ProcessCtx_t[]>(new ProcessCtx_t[impl_->nprocess_routine]);
325 for (int i{0}; i < impl_->nprocess_routine; ++i) {
326 auto &&ctx = process_ctxs[i];
327 ctx.vtid = vtid;
328 ctx.pid = i;
329 ctx.batch_helper = this;
330
331 co_create(&(ctx.co), &attr, ProcessRoutineRun, &ctx);
332 co_resume(ctx.co);
333 }
334
335 DispatchCtx_t ctx;
336 ctx.batch_helper = this;
337 ctx.vtid = vtid;
338 co_eventloop(co_get_epoll_ct(), DispatchTickRun, &ctx);
339
340 QLErr("DaemonThreadRun end");
341 exit(0);
342}
343
344comm::RetCode BatchHelper::BatchRawAdd(const comm::proto::AddRequest &req) {
345 auto batch_key = tuple<int, int, int>(req.topic_id(), req.store_id(), req.queue_id());

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected