Skip to main content

PullSession Class

Fluent builder for the common "collect samples until target/stall" workflow. More...

Declaration

class simaai::neat::graph::GraphRun::PullSession { ... }

Included Headers

#include <GraphRun.h>

Friends Index

classGraphRun

Private Constructors Index

PullSession (GraphRun *run, const std::vector< Output > *outputs, std::vector< NodeId > output_nodes, GraphRunStats *stats)

Public Member Functions Index

PullSession &per_stream_target (int n)

Stop once each tracked stream has produced this many samples. More...

PullSession &stall_after_ms (int ms)

Stop after this many ms with no progress (stall detection). More...

PullSession &timeout_ms (int ms)

Per-poll timeout (ms). More...

PullSession &max_runtime_ms (int ms)

Hard wall-clock cap (ms) on the entire session. More...

PullSession &expect_streams (std::vector< std::string > ids)

Limit tracking to these stream-ids (and treat anything else as unexpected). More...

PullSession &on_sample (std::function< void(const Sample &, NodeId)> cb)

Callback fired on every successfully pulled sample. More...

GraphRunStats &stats ()

Live reference to the stats collector this session writes to. More...

voidrun ()

Execute the configured pull loop. Blocks until done/stall/max-runtime. More...

Private Member Attributes Index

GraphRun *run_ = nullptr
const std::vector< Output > *outputs_ = nullptr
std::vector< NodeId >output_nodes_
GraphRunStats *stats_ = nullptr
GraphRunPullOptionsopt_
std::unordered_set< std::string >expected_
std::unordered_set< std::string >unknown_
boolsaw_empty_stream_id_ = false
std::function< void(const Sample &, NodeId)>on_sample_

Description

Fluent builder for the common "collect samples until target/stall" workflow.

Configure with chainable setters, then call run(). The session pulls from the configured outputs until per-stream targets are met, the runtime stalls, or the max-runtime cap is hit.

 run.collect({run.output(sink_id)})
  .stall_after_ms(2000)
  .on_sample([](const Sample& s, NodeId n) { ... })
  .run();

Definition at line 269 of file GraphRun.h.

Friends

GraphRun

friend class GraphRun

Definition at line 289 of file GraphRun.h.

289 friend class GraphRun;

Private Constructors

PullSession()

simaai::neat::graph::GraphRun::PullSession::PullSession (GraphRun * run, const std::vector< Output > * outputs, std::vector< NodeId > output_nodes, GraphRunStats * stats)

Definition at line 290 of file GraphRun.h.

Public Member Functions

expect_streams()

PullSession & simaai::neat::graph::GraphRun::PullSession::expect_streams (std::vector< std::string > ids)

Limit tracking to these stream-ids (and treat anything else as unexpected).

Definition at line 280 of file GraphRun.h.

max_runtime_ms()

PullSession & simaai::neat::graph::GraphRun::PullSession::max_runtime_ms (int ms)

Hard wall-clock cap (ms) on the entire session.

Definition at line 278 of file GraphRun.h.

on_sample()

PullSession & simaai::neat::graph::GraphRun::PullSession::on_sample (std::function< void(const Sample &, NodeId)> cb)

Callback fired on every successfully pulled sample.

Definition at line 282 of file GraphRun.h.

per_stream_target()

PullSession & simaai::neat::graph::GraphRun::PullSession::per_stream_target (int n)

Stop once each tracked stream has produced this many samples.

Definition at line 272 of file GraphRun.h.

run()

void simaai::neat::graph::GraphRun::PullSession::run ()

Execute the configured pull loop. Blocks until done/stall/max-runtime.

Definition at line 286 of file GraphRun.h.

stall_after_ms()

PullSession & simaai::neat::graph::GraphRun::PullSession::stall_after_ms (int ms)

Stop after this many ms with no progress (stall detection).

Definition at line 274 of file GraphRun.h.

stats()

GraphRunStats & simaai::neat::graph::GraphRun::PullSession::stats ()

Live reference to the stats collector this session writes to.

Definition at line 284 of file GraphRun.h.

timeout_ms()

PullSession & simaai::neat::graph::GraphRun::PullSession::timeout_ms (int ms)

Per-poll timeout (ms).

Definition at line 276 of file GraphRun.h.

Private Member Attributes

expected_

std::unordered_set<std::string> simaai::neat::graph::GraphRun::PullSession::expected_

Definition at line 298 of file GraphRun.h.

298 std::unordered_set<std::string> expected_;

on_sample_

std::function<void(const Sample&, NodeId)> simaai::neat::graph::GraphRun::PullSession::on_sample_

Definition at line 301 of file GraphRun.h.

301 std::function<void(const Sample&, NodeId)> on_sample_;

opt_

GraphRunPullOptions simaai::neat::graph::GraphRun::PullSession::opt_

Definition at line 297 of file GraphRun.h.

output_nodes_

std::vector<NodeId> simaai::neat::graph::GraphRun::PullSession::output_nodes_

Definition at line 295 of file GraphRun.h.

295 std::vector<NodeId> output_nodes_;

outputs_

const std::vector<Output>* simaai::neat::graph::GraphRun::PullSession::outputs_ = nullptr

Definition at line 294 of file GraphRun.h.

294 const std::vector<Output>* outputs_ = nullptr;

run_

GraphRun* simaai::neat::graph::GraphRun::PullSession::run_ = nullptr

Definition at line 293 of file GraphRun.h.

293 GraphRun* run_ = nullptr;

saw_empty_stream_id_

bool simaai::neat::graph::GraphRun::PullSession::saw_empty_stream_id_ = false

Definition at line 300 of file GraphRun.h.

300 bool saw_empty_stream_id_ = false;

stats_

GraphRunStats* simaai::neat::graph::GraphRun::PullSession::stats_ = nullptr

Definition at line 296 of file GraphRun.h.

296 GraphRunStats* stats_ = nullptr;

unknown_

std::unordered_set<std::string> simaai::neat::graph::GraphRun::PullSession::unknown_

Definition at line 299 of file GraphRun.h.

299 std::unordered_set<std::string> unknown_;

The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.