| 248 | } |
| 249 | |
| 250 | void QuickJSRuntime::dispatch_tasker_sink(MaaTasker* handle, const char* message, const char* details_json) |
| 251 | { |
| 252 | std::promise<void> promise; |
| 253 | std::future<void> future = promise.get_future(); |
| 254 | d_->push_task([&promise, handle, message, details_json, &sinks = d_->plugin_tasker_sinks](JSContext*) { |
| 255 | for (const auto& sink : sinks) { |
| 256 | sink(handle, message, details_json); |
| 257 | } |
| 258 | promise.set_value(); |
| 259 | }); |
| 260 | return future.get(); |
| 261 | } |
| 262 | |
| 263 | void QuickJSRuntime::dispatch_context_sink(MaaContext* handle, const char* message, const char* details_json) |
| 264 | { |
no test coverage detected