itch-mold-replay 1.0
Time-accurate NASDAQ TotalView-ITCH 5.0 replay over MoldUDP64
Loading...
Searching...
No Matches
imr::mold::retransmission::FeedPool Class Reference

Owns N (num_feeds) retransmission feeds. More...

#include <feed_pool.h>

Public Member Functions

 FeedPool (std::size_t num_feeds, const Feed::Config &feed_cfg, const PacketBuilder::Config &packet_builder_cfg, std::span< const char > file, const RetransmissionBuffer &retransmission_buffer)
 Constructs and starts num_feeds retransmission feeds in their own threads.
 
void stop () const
 Signals all feed threads to stop by writing to the shared shutdown_fd_.
 

Detailed Description

Owns N (num_feeds) retransmission feeds.

Each feed runs own event loop in dedicated thread. All feeds share a single eventfd used to signal shutdown (via stop())

Constructor & Destructor Documentation

◆ FeedPool()

imr::mold::retransmission::FeedPool::FeedPool ( std::size_t  num_feeds,
const Feed::Config feed_cfg,
const PacketBuilder::Config packet_builder_cfg,
std::span< const char >  file,
const RetransmissionBuffer retransmission_buffer 
)

Constructs and starts num_feeds retransmission feeds in their own threads.

Each thread construct an instance of imr::mold::retransmission::Feed and then starts it immediately.

Exceptions
std::system_errorif the shutdown eventfd fails to be created.

Member Function Documentation

◆ stop()

void imr::mold::retransmission::FeedPool::stop ( ) const

Signals all feed threads to stop by writing to the shared shutdown_fd_.

This is async so retransmission feeds meaning retransmission feeds might finish requests in their epoll set before receiving the shutdown signal

Exceptions
std::system_errorif write() to shutdown_fd_ fails.

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