Holoscan SDK v4.2.0

Class PublisherAvailableCondition

Base Type

class PublisherAvailableCondition : public holoscan::Condition

Native condition that gates execution on pub/sub publisher match readiness.

This condition is ready when the configured receiver has at least min_publisher_count matched publishers.

==Parameters==

  • receiver (std::shared_ptr<holoscan::Receiver>, required): The receiver to monitor. In most applications this is provided as an input port name (for example Arg("receiver", "in")) and resolved by the framework.

  • min_publisher_count (uint64_t, optional, default 1): Minimum number of matched publishers required for READY state.

  • require_pubsub_connector (bool, optional, default true): If true, the receiver must resolve to a PubSubReceiver, otherwise initialization throws.

  • poll_period_ms (int64_t, optional, default 100): Polling interval used while waiting for matched publishers. The condition returns WAIT_TIME until the next poll.

  • latch_ready (bool, optional, default false): If true, once the condition becomes ready it remains ready for the lifetime of the condition rather than returning to wait on later disconnects.

Public Functions

HOLOSCAN_CONDITION_FORWARD_ARGS (PublisherAvailableCondition) PublisherAvailableCondition()=default
virtual void setup(ComponentSpec &spec) override

Define the condition specification.

Parameters

spec – The reference to the component specification.

virtual void initialize() override

Initialize the component.

This method is called only once when the component is created for the first time, and use of light-weight initialization.

virtual void update_state(int64_t timestamp) override

Checks if the state of the condition can be updated and updates it.

Parameters

timestamp – The current timestamp

virtual void check(int64_t timestamp, SchedulingStatusType *status_type, int64_t *target_timestamp) const override

Check the condition status before allowing execution.

If the condition is waiting for a time event ‘target_timestamp’ will contain the target timestamp.

Parameters
  • timestamp – The current timestamp

  • status_type – The status of the condition

  • target_timestamp – The target timestamp (used if the term is waiting for a time event).

virtual void on_execute(int64_t timestamp) override

Called each time after the entity of this term was executed.

Parameters

timestamp – The current timestamp

Previous Class PresentDoneCondition
Next Class PubSubContext
© Copyright 2022-2026, NVIDIA. Last updated on May 11, 2026