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

Method DoWorkWithAsyncRes

test/async_worker.cc:20–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18 }
19
20 static void DoWorkWithAsyncRes(const CallbackInfo& info) {
21 Object recv = info[0].As<Object>();
22 Function cb = info[1].As<Function>();
23 Value resource = info[2];
24
25 TestWorkerWithUserDefRecv* worker = nullptr;
26 if (resource == info.Env().Null()) {
27 worker = new TestWorkerWithUserDefRecv(recv, cb, "TestResource");
28 } else {
29 worker = new TestWorkerWithUserDefRecv(
30 recv, cb, "TestResource", resource.As<Object>());
31 }
32
33 worker->Queue();
34 }
35
36 protected:
37 void Execute() override {}

Callers

nothing calls this directly

Calls 2

EnvMethod · 0.80
QueueMethod · 0.80

Tested by

no test coverage detected