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

Method Execute

test/async_progress_worker.cc:184–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182
183 protected:
184 void Execute(const ExecutionProgress& progress) override {
185 if (_times < 0) {
186 SetError("test error");
187 }
188 ProgressData data{0};
189
190 for (int32_t idx = 0; idx < _times; idx++) {
191 data.progress = idx;
192 progress.Send(&data, 1);
193
194 {
195 std::unique_lock<std::mutex> lk(_cvm);
196 _cv.wait(lk, [this] { return dataSent; });
197 dataSent = false;
198 }
199 }
200 }
201
202 void OnProgress(const ProgressData* data, size_t /* count */) override {
203 Napi::Env env = Env();

Callers

nothing calls this directly

Calls 1

SendMethod · 0.80

Tested by

no test coverage detected