MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / dispatch_controller_sink

Method dispatch_controller_sink

source/binding/NodeJS/src/plugin/runtime.cpp:237–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237void 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
250void QuickJSRuntime::dispatch_tasker_sink(MaaTasker* handle, const char* message, const char* details_json)
251{

Callers 1

OnControllerEventFunction · 0.80

Calls 2

push_taskMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected