Class SubscriberAvailableCondition
Defined in File subscriber_available.hpp
Base Type
public holoscan::Condition(Class Condition)
-
class SubscriberAvailableCondition : public holoscan::Condition
Native condition that gates execution on pub/sub subscriber match readiness.
This condition is ready when the configured transmitter has at least
min_subscriber_countmatched subscribers.==Parameters==
transmitter (
std::shared_ptr<holoscan::Transmitter>, required): The transmitter to monitor. In most applications this is provided as an output port name (for exampleArg("transmitter", "out")) and resolved by the framework.min_subscriber_count (
uint64_t, optional, default1): Minimum number of matched subscribers required for READY state.require_pubsub_connector (
bool, optional, defaulttrue): If true, the transmitter must resolve to aPubSubTransmitter, otherwise initialization throws.poll_period_ms (
int64_t, optional, default100): Polling interval used while waiting for matched subscribers. The condition returnsWAIT_TIMEuntil the next poll.stabilization_ms (
int64_t, optional, default0): Optional post-match stabilization delay. When greater than zero, the condition waits for the match criterion to remain satisfied for this duration before transitioning to READY.latch_ready (
bool, optional, defaultfalse): If true, once the condition becomes ready it remains ready for the lifetime of the condition rather than returning to wait on later disconnects.ready_on_shutdown (
bool, optional, defaultfalse): Reserved policy flag for future coordinated-shutdown behavior.
Public Functions
- HOLOSCAN_CONDITION_FORWARD_ARGS (SubscriberAvailableCondition) SubscriberAvailableCondition()=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