Skip to content

sgns::processing::ProcessingNode

Node for distributed computation. More...

#include <processing_node.hpp>

Inherits from std::enable_shared_from_this< ProcessingNode >

Public Functions

Name
std::shared_ptr< ProcessingNode > New(std::shared_ptr< ipfs_pubsub::GossipPubSub > gossipPubSub, std::shared_ptr< SubTaskResultStorage > subTaskResultStorage, std::shared_ptr< ProcessingCore > processingCore, std::function< void(const SGProcessing::TaskResult &)> taskResultProcessingSink, std::function< void(const std::string &)> processingErrorSink, std::function< void(void)> processingDoneSink, std::string node_id, const std::string & processingQueueChannelId, std::list< SGProcessing::SubTask > subTasks ={}, std::chrono::milliseconds msSubscriptionWaitingDuration =std::chrono::milliseconds(2000), std::chrono::seconds ttl =std::chrono::minutes(2))
Creates a processing node instance.
~ProcessingNode()
bool HasQueueOwnership() const
float GetProgress() const

Detailed Description

class sgns::processing::ProcessingNode;

Node for distributed computation.

Coordinates subtask queue ownership, processing, and result publication.

Public Functions Documentation

function New

static std::shared_ptr< ProcessingNode > New(
    std::shared_ptr< ipfs_pubsub::GossipPubSub > gossipPubSub,
    std::shared_ptr< SubTaskResultStorage > subTaskResultStorage,
    std::shared_ptr< ProcessingCore > processingCore,
    std::function< void(const SGProcessing::TaskResult &)> taskResultProcessingSink,
    std::function< void(const std::string &)> processingErrorSink,
    std::function< void(void)> processingDoneSink,
    std::string node_id,
    const std::string & processingQueueChannelId,
    std::list< SGProcessing::SubTask > subTasks ={},
    std::chrono::milliseconds msSubscriptionWaitingDuration =std::chrono::milliseconds(2000),
    std::chrono::seconds ttl =std::chrono::minutes(2)
)

Creates a processing node instance.

Parameters:

  • gossipPubSub PubSub service for queue coordination.
  • subTaskResultStorage Storage for subtask results.
  • processingCore Processing core to execute subtasks.
  • taskResultProcessingSink Callback for task result processing.
  • processingErrorSink Callback for processing errors.
  • processingDoneSink Callback when processing is done.
  • node_id Identifier of the processing node.
  • processingQueueChannelId Queue channel identifier.
  • subTasks Optional initial subtask list.
  • msSubscriptionWaitingDuration Wait duration for queue subscription.
  • ttl Time-to-live for node ownership.

function ~ProcessingNode

~ProcessingNode()

function HasQueueOwnership

bool HasQueueOwnership() const

function GetProgress

float GetProgress() const

Return: Progress percentage (0.0 to 100.0)

Get current processing progress


Updated on 2026-03-04 at 13:10:43 -0800