API referenceVetraGlove ProC++

Subscription policies

Channels & subscriptions

Current version · 2.0.0

The first available sample is delivered immediately. Each later max_rate_hz period includes callback time, so the SDK waits only for the remainder. If a callback takes longer than the period, delivery continues with the next available sample, without catch-up deliveries. The rate uses the time from first to last delivery and allows one extra sample at the window boundary. To measure delivery intervals, record the monotonic time when each sample arrives and subtract consecutive readings.

Callback time counts toward the period starting in Core/Glove 1.6.0. See Migration when upgrading older code.

Defines delivery for a subscription view used through with_config(). It affects subsequent subscriptions, not latest(), next(), existing subscriptions, or SDK/algorithm computation rates.

SubscriptionConfig::latest()

Deliver only the newest value in each pacing interval.

Type

SubscriptionConfig SubscriptionConfig::latest(std::optional<double> max_rate_hz = std::nullopt);

Parameters

  • max_rate_hz: defaults to std::nullopt with no delivery rate cap; a supplied value must be positive and finite.

Details

  • Call conditions: Configuring callbacks.

Errors

  • Invalid rate.

Example

auto config = qnbot::SubscriptionConfig::latest(30.0);

Complete example: subscription_config.cpp.

SubscriptionConfig::fifo()

Use a bounded ordered queue; drop the oldest item when full.

Type

SubscriptionConfig SubscriptionConfig::fifo(
    std::size_t capacity,
    std::optional<double> max_rate_hz = std::nullopt
);

Parameters

  • capacity: required and positive; a full queue discards the oldest pending value.
  • max_rate_hz: defaults to std::nullopt with no delivery rate cap; a supplied value must be positive and finite.

Details

  • Call conditions: Configuring callbacks.

Errors

  • Invalid capacity or rate.

Example

auto config = qnbot::SubscriptionConfig::fifo(128, 30.0);

Complete example: subscription_config.cpp.