Skip to content

sgns::neoswarm::network::ResultAggregation

Collects NodeOutput responses from swarm peers with a timeout. More...

#include <result_aggregation.hpp>

Public Classes

Name
struct Config

Public Functions

Name
ResultAggregation()
ResultAggregation(Config cfg)
void Submit(const NodeOutput & output)
Submit a response from a node (thread-safe).
outcome::result< std::vector< NodeOutput > > Collect()
Wait for responses and return collected results.
void Reset()
Reset for a new collection round.
size_t ResponseCount() const

Detailed Description

class sgns::neoswarm::network::ResultAggregation;

Collects NodeOutput responses from swarm peers with a timeout.

Returns as soon as min_responses_ are received or the timeout expires.

Public Functions Documentation

function ResultAggregation

ResultAggregation()

function ResultAggregation

explicit ResultAggregation(
    Config cfg
)

function Submit

void Submit(
    const NodeOutput & output
)

Submit a response from a node (thread-safe).

Parameters:

  • output Node output to add to the collection.

function Collect

outcome::result< std::vector< NodeOutput > > Collect()

Wait for responses and return collected results.

Return: Vector of collected NodeOutputs or BroadcastTimeout.

Blocks until min_responses_ received or timeout expires.

function Reset

void Reset()

Reset for a new collection round.

function ResponseCount

size_t ResponseCount() const

Return: Number of responses received so far.


Updated on 2026-07-25 at 22:56:56 +0000