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

Method DoWork

test/async_worker_persistent.cc:14–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12 public:
13 static PersistentTestWorker* current_worker;
14 static void DoWork(const CallbackInfo& info) {
15 bool succeed = info[0].As<Boolean>();
16 Function cb = info[1].As<Function>();
17
18 PersistentTestWorker* worker = new PersistentTestWorker(cb, "TestResource");
19 current_worker = worker;
20
21 worker->SuppressDestruct();
22 worker->_succeed = succeed;
23 worker->Queue();
24 }
25
26 static Value GetWorkerGone(const CallbackInfo& info) {
27 return Boolean::New(info.Env(), current_worker == nullptr);

Callers

nothing calls this directly

Calls 2

SuppressDestructMethod · 0.80
QueueMethod · 0.80

Tested by

no test coverage detected