| 170 | class TestWorker : public AsyncProgressQueueWorker<ProgressData> { |
| 171 | public: |
| 172 | static Napi::Value CreateWork(const CallbackInfo& info) { |
| 173 | int32_t times = info[0].As<Number>().Int32Value(); |
| 174 | Function cb = info[1].As<Function>(); |
| 175 | Function progress = info[2].As<Function>(); |
| 176 | |
| 177 | TestWorker* worker = new TestWorker( |
| 178 | cb, progress, "TestResource", Object::New(info.Env()), times); |
| 179 | |
| 180 | return Napi::External<TestWorker>::New(info.Env(), worker); |
| 181 | } |
| 182 | |
| 183 | static void QueueWork(const CallbackInfo& info) { |
| 184 | auto wrap = info[0].As<Napi::External<TestWorker>>(); |