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

Method OnProgress

test/async_progress_worker.cc:202–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200 }
201
202 void OnProgress(const ProgressData* data, size_t /* count */) override {
203 Napi::Env env = Env();
204 if (!_progress.IsEmpty()) {
205 Number progress = Number::New(env, data->progress);
206 _progress.MakeCallback(Receiver().Value(), {progress});
207 }
208
209 {
210 std::lock_guard<std::mutex> lk(_cvm);
211 dataSent = true;
212 _cv.notify_one();
213 }
214 }
215
216 private:
217 TestWorker(Function cb,

Callers 1

OnWorkProgressMethod · 0.45

Calls 4

EnvClass · 0.85
IsEmptyMethod · 0.80
MakeCallbackMethod · 0.80
ValueMethod · 0.80

Tested by

no test coverage detected