| 170 | class TestWorker : public AsyncProgressWorker<ProgressData> { |
| 171 | public: |
| 172 | static void DoWork(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 = |
| 178 | new TestWorker(cb, progress, "TestResource", Object::New(info.Env())); |
| 179 | worker->_times = times; |
| 180 | worker->Queue(); |
| 181 | } |
| 182 | |
| 183 | protected: |
| 184 | void Execute(const ExecutionProgress& progress) override { |