MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / refreshAnyAsyncSink

Method refreshAnyAsyncSink

app/src/DataModel/FrameBuilder.cpp:508–523  ·  view source on GitHub ↗

* @brief Recomputes the cached any-async-consumer flag from every export/output module. The * TCP and gRPC servers only count while a client is connected: with zero clients their * workers drop every frame, so the per-frame detached copy would be pure waste. */

Source from the content-addressed store, hash-verified

506 * workers drop every frame, so the per-frame detached copy would be pure waste.
507 */
508void DataModel::FrameBuilder::refreshAnyAsyncSink()
509{
510 const auto& server = API::Server::instance();
511 bool any = CSV::Export::instance().exportEnabled() || MDF4::Export::instance().exportEnabled()
512 || (server.enabled() && server.clientCount() > 0);
513#ifdef BUILD_COMMERCIAL
514 any =
515 any || Sessions::Export::instance().exportEnabled() || MQTT::Publisher::instance().enabled();
516#endif
517#ifdef ENABLE_GRPC
518 const auto& grpc = API::GRPC::GRPCServer::instance();
519 any = any || (grpc.enabled() && grpc.clientCount() > 0);
520#endif
521
522 m_anyAsyncSink = any;
523}
524
525/**
526 * @brief Recomputes the cached latest-frame capture flag (control script or API server active);

Callers

nothing calls this directly

Calls 3

exportEnabledMethod · 0.45
enabledMethod · 0.45
clientCountMethod · 0.45

Tested by

no test coverage detected