MCPcopy Index your code
hub / github.com/nodejs/node-addon-api / DoWork

Method DoWork

test/async_progress_queue_worker.cc:137–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135class TestWorkerWithCb : public AsyncProgressQueueWorker<ProgressData> {
136 public:
137 static void DoWork(const CallbackInfo& info) {
138 switch (info.Length()) {
139 case 1: {
140 Function cb = info[0].As<Function>();
141 TestWorkerWithCb* worker = new TestWorkerWithCb(cb);
142 worker->Queue();
143 } break;
144
145 case 2: {
146 Function cb = info[0].As<Function>();
147 std::string asyncResName = info[1].As<String>();
148 TestWorkerWithCb* worker =
149 new TestWorkerWithCb(cb, asyncResName.c_str());
150 worker->Queue();
151 } break;
152
153 default:
154
155 break;
156 }
157 }
158
159 protected:
160 void Execute(const ExecutionProgress&) override {}

Callers

nothing calls this directly

Calls 2

LengthMethod · 0.80
QueueMethod · 0.80

Tested by

no test coverage detected