Skip to main content

Module slots

Module slots 

Source
Expand description

worker-local slots for packet-loop identities

slots solve the mismatch between stable transport ids and packet-loop work

room commands, diagnostics and teardown
  use stable public keys such as TransportSessionKey or TransportMediaId
  those keys are meaningful outside one media worker

packet-loop queues, timeout heaps and route destinations
  use tiny copy handles
  those handles are only meaningful inside the store that created them

the worker must accept that some work is already queued when a session, media entry or consumer route is removed a bare index would let that delayed work reach a replacement occupant after the index is recycled SlotHandle prevents that by pairing the index with the generation that was current when the handle was created removal advances the generation before reuse, so stale dirty-session marks, timeout heap entries and route destinations become ordinary no-ops instead of touching new state

the tag parameter is part of the contract it keeps session handles, media handles and consumer stream handles in separate type namespaces even though every handle is represented by the same compact index plus generation pair

Structsยง

ConsumerStreamSlot ๐Ÿ”’
handle namespace for downstream RTP rewrite state
KeyedSlot ๐Ÿ”’
KeyedSlotStore ๐Ÿ”’
public-key index backed by generation slots
MediaSlot ๐Ÿ”’
handle namespace for registered media entries
SessionSlot ๐Ÿ”’
handle namespace for live RtcSessionState entries
SlotEntry ๐Ÿ”’
SlotHandle ๐Ÿ”’
copy identity for one reusable worker-local slot
SlotStore ๐Ÿ”’
dense reusable storage for one worker-local identity class

Functionsยง

next_generation ๐Ÿ”’

Type Aliasesยง

ConsumerStreamHandle ๐Ÿ”’
generation-checked handle stored on route destinations for local RTP rewrite state
MediaStore ๐Ÿ”’
media table keyed by the stable transport media id exposed outside the worker
SessionHandle ๐Ÿ”’
generation-checked session handle used by packet-loop scheduler queues
SessionStore ๐Ÿ”’
session table keyed by the public session identity at the worker boundary