| 235 | } |
| 236 | |
| 237 | void QuickJSRuntime::dispatch_controller_sink(MaaController* handle, const char* message, const char* details_json) |
| 238 | { |
| 239 | std::promise<void> promise; |
| 240 | std::future<void> future = promise.get_future(); |
| 241 | d_->push_task([&promise, handle, message, details_json, &sinks = d_->plugin_controller_sinks](JSContext*) { |
| 242 | for (const auto& sink : sinks) { |
| 243 | sink(handle, message, details_json); |
| 244 | } |
| 245 | promise.set_value(); |
| 246 | }); |
| 247 | return future.get(); |
| 248 | } |
| 249 | |
| 250 | void QuickJSRuntime::dispatch_tasker_sink(MaaTasker* handle, const char* message, const char* details_json) |
| 251 | { |
no test coverage detected