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

Method Execute

test/async_progress_queue_worker.cc:190–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188
189 protected:
190 void Execute(const ExecutionProgress& progress) override {
191 using namespace std::chrono_literals;
192 std::this_thread::sleep_for(1s);
193
194 if (_times < 0) {
195 SetError("test error");
196 } else {
197 progress.Signal();
198 }
199 ProgressData data{0};
200 for (int32_t idx = 0; idx < _times; idx++) {
201 data.progress = idx;
202 progress.Send(&data, 1);
203 }
204 }
205
206 void OnProgress(const ProgressData* data, size_t count) override {
207 Napi::Env env = Env();

Callers

nothing calls this directly

Calls 2

SignalMethod · 0.80
SendMethod · 0.80

Tested by

no test coverage detected