Skip to main content

Module topic_router

Module topic_router 

Source
Expand description

TopicRouter — Intelligent GossipSub topic management with priority-based message queuing.

This module provides a production-grade topic router that sits above the raw GossipSub layer and adds:

  • Per-topic configuration (queue depth, priority threshold, TTL)
  • Lock-free per-topic message counters via Arc<AtomicU64>
  • Priority queues backed by BinaryHeap — highest-priority messages dequeued first
  • Automatic drop of messages below a topic’s priority_threshold
  • Bounded queues — messages rejected with QueueFull when max_queue_depth is exceeded
  • Aggregate statistics with atomic accumulators and a snapshot() API

Structs§

PrioritizedMessage
A message that can be stored in a per-topic BinaryHeap.
TopicConfig
Per-topic routing configuration.
TopicRouter
Intelligent GossipSub topic manager with priority-based message queuing.
TopicRouterStats
Atomic accumulator for aggregate router statistics.
TopicRouterStatsSnapshot
A point-in-time snapshot of aggregate router statistics.

Enums§

TopicError
Errors that can occur in TopicRouter operations.