STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
SubscriptionTracker Class Reference

SubscriptionTracker + ElodinClient::subscribe_table: a subscription the DB refuses is asked for again, and only that one. More...

#include <SubscriptionTracker.hpp>

Collaboration diagram for SubscriptionTracker:
[legend]

Public Types

using Table = std::pair<uint8_t, uint8_t>
using Clock = std::chrono::steady_clock

Public Member Functions

 SubscriptionTracker (std::chrono::milliseconds retry_after=std::chrono::seconds(1))
uint8_t assign (Table table)
 The request id to subscribe table under.
Table rejected (uint8_t request_id, Clock::time_point now)
 The DB refused the subscription sent under request_id.
std::vector< Table > due (Clock::time_point now)
 Refused tables whose wait is over; each is forgotten here until rejected again.
size_t refused () const
 Tables currently waiting to be asked for again.
void reset ()
 A new connection: every subscription is sent afresh.

Private Attributes

std::chrono::milliseconds retry_after_
uint8_t next_id_ = 1
std::map< uint8_t, Table > by_id_
std::map< Table, Clock::time_point > retry_at_

Detailed Description

SubscriptionTracker + ElodinClient::subscribe_table: a subscription the DB refuses is asked for again, and only that one.

On 2026-11-05 calibration_service subscribed to the ball valve's raw tables a moment before daq_bridge registered them. The DB refused (ErrorResponse, echoing the request id), nothing noticed, and no ball valve position was published for the whole session. Calibration's only recovery was "no packets at all for 5 s", which never fires while other tables stream.

Definition at line 36 of file SubscriptionTracker.hpp.

Member Typedef Documentation

◆ Clock

using fsw::elodin::SubscriptionTracker::Clock = std::chrono::steady_clock

Definition at line 39 of file SubscriptionTracker.hpp.

◆ Table

using fsw::elodin::SubscriptionTracker::Table = std::pair<uint8_t, uint8_t>

Definition at line 38 of file SubscriptionTracker.hpp.

Constructor & Destructor Documentation

◆ SubscriptionTracker()

fsw::elodin::SubscriptionTracker::SubscriptionTracker ( std::chrono::milliseconds retry_after = std::chrono::seconds(1))
inlineexplicit

Definition at line 41 of file SubscriptionTracker.hpp.

Member Function Documentation

◆ assign()

The request id to subscribe table under.

Ids rotate through 1..254: 0 is what untracked subscriptions use, and 255 is the backend's subscription fence.

Definition at line 49 of file SubscriptionTracker.hpp.

◆ due()

std::vector< Table > fsw::elodin::SubscriptionTracker::due ( Clock::time_point now)
inline

Refused tables whose wait is over; each is forgotten here until rejected again.

Definition at line 71 of file SubscriptionTracker.hpp.

◆ refused()

Tables currently waiting to be asked for again.

Definition at line 85 of file SubscriptionTracker.hpp.

◆ rejected()

Table fsw::elodin::SubscriptionTracker::rejected ( uint8_t request_id,
Clock::time_point now )
inline

The DB refused the subscription sent under request_id.

Returns the table it was for, so the caller can say which; {0, 0} for an id this tracker did not hand out.

Definition at line 60 of file SubscriptionTracker.hpp.

◆ reset()

A new connection: every subscription is sent afresh.

Definition at line 90 of file SubscriptionTracker.hpp.

Member Data Documentation

◆ by_id_

std::map<uint8_t, Table> fsw::elodin::SubscriptionTracker::by_id_
private

Definition at line 98 of file SubscriptionTracker.hpp.

◆ next_id_

Definition at line 97 of file SubscriptionTracker.hpp.

◆ retry_after_

std::chrono::milliseconds fsw::elodin::SubscriptionTracker::retry_after_
private

Definition at line 96 of file SubscriptionTracker.hpp.

◆ retry_at_

std::map<Table, Clock::time_point> fsw::elodin::SubscriptionTracker::retry_at_
private

Definition at line 99 of file SubscriptionTracker.hpp.


The documentation for this class was generated from the following file: