Skip to main content

Module route_graph

Module route_graph 

Source
Expand description

Logical subscriptions and their transport realization.

Explicit receiver intent survives while no publication is attached. A current publication realizes as Absent -> Pending -> Committed. Current setup failures, router rejection and receiver replacement return realization to Absent. Reservation IDs reject async completion after source detach or replacement.

logical subscription realization:
     publication attached
             |
             v
  +--------------------+  reserve setup
  | ConsumerRealization| ------------------> +-------------------------------------+
  |      Absent        |                     | ConsumerRealization::Pending        |
  +--------------------+ <------------------ | (RouteReservationId, Option<Relay>) |
             ^       setup fails/rejected    +-------------------------------------+
             |                                                  |
             |              decline/replace                     v setup accepted
             +---------------------------------- +---------------------------------+
                                                 | ConsumerRealization::Committed  |
                                                 +---------------------------------+

cross-worker relay sharing:
  receiver 1 (worker B) \
  receiver 2 (worker B)  --> [ RelayRouteKey (source worker A -> worker B) ]
  receiver 3 (worker B) /               |
                                        v
                        shared relay channel (worker A -> B)
                                        |
                            +-----------+-----------+
                            v           v           v
                         recv 1      recv 2      recv 3 (local fanout on worker B)

Intent without a current publication keeps Subscription.current at None. Accepted setup requires a current identity, a successful transport declaration and router dependency acceptance. Source detach returns to None while retaining intent. remove_receiver deletes the record and its intent.

Each receiver retains at most the room session limit of absent publisher targets. Sparse updates keep the target’s original age. A new target evicts every stream preference of the oldest absent target. Present members do not consume this allowance, including members with no publications. Joining promotes existing intent and departure enters the allowance as a new target.

Cross-worker relays are shared by subscriptions with the same source and target worker. A relay remains active while any owner has active receiver intent. An active first owner emits Install followed by SetActivity(Active). Later aggregate activity changes emit SetActivity. Removing the last owner emits Release.

StructsΒ§

CommittedConsumerRoute πŸ”’
Transport realization and adaptation hold share the exact route lifetime.
ConsumerRouteReservation
CurrentPublication πŸ”’
PendingUpgrade πŸ”’
Eligibility must remain continuous for this exact deliverable post-fit target.
RelayRouteKey
Captured source placement survives replacement until its relay owners release it.
RemovedRoutes πŸ”’
RouteGraph πŸ”’
RouteRelay πŸ”’
RouteReservationId πŸ”’
Subscription πŸ”’
TakenPending πŸ”’

EnumsΒ§

ConsumerRealization πŸ”’

FunctionsΒ§

relay_aggregate πŸ”’
relay_effects_for πŸ”’

Type AliasesΒ§

RelayOwners πŸ”’