| 135 | class TestWorkerWithCb : public AsyncProgressQueueWorker<ProgressData> { |
| 136 | public: |
| 137 | static void DoWork(const CallbackInfo& info) { |
| 138 | switch (info.Length()) { |
| 139 | case 1: { |
| 140 | Function cb = info[0].As<Function>(); |
| 141 | TestWorkerWithCb* worker = new TestWorkerWithCb(cb); |
| 142 | worker->Queue(); |
| 143 | } break; |
| 144 | |
| 145 | case 2: { |
| 146 | Function cb = info[0].As<Function>(); |
| 147 | std::string asyncResName = info[1].As<String>(); |
| 148 | TestWorkerWithCb* worker = |
| 149 | new TestWorkerWithCb(cb, asyncResName.c_str()); |
| 150 | worker->Queue(); |
| 151 | } break; |
| 152 | |
| 153 | default: |
| 154 | |
| 155 | break; |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | protected: |
| 160 | void Execute(const ExecutionProgress&) override {} |