Webserv
|
Centralised event demultiplexer and dispatcher for managing I/O events. More...
#include <InitiationDispatcher.hpp>
Public Member Functions | |
void | registerHandler (AEventHandler *handler) |
void | removeHandler (int fd) |
void | handleEvents () |
void | requestShutdown () |
EpollManager & | getEpollManager () |
Static Public Member Functions | |
static InitiationDispatcher & | getInstance () |
Private Member Functions | |
InitiationDispatcher () | |
~InitiationDispatcher () | |
InitiationDispatcher (const InitiationDispatcher &) | |
InitiationDispatcher & | operator= (const InitiationDispatcher &) |
Private Attributes | |
EpollManager | epollManager_ |
std::map< int, AEventHandler * > | handlers_ |
Centralised event demultiplexer and dispatcher for managing I/O events.
InitiationDispatcher coordinates between the event detection mechanism (epoll) and register event handlers. It maintains a registry of handlers, waits for events to occur on monitored file descriptors, and dispatches events to appropriate handlers. This implements the core of the Reactor pattern for non-blocking, event-driven I/O.
|
private |
|
private |
|
private |
EpollManager & network::InitiationDispatcher::getEpollManager | ( | ) |
|
static |
void network::InitiationDispatcher::handleEvents | ( | ) |
|
private |
void network::InitiationDispatcher::registerHandler | ( | AEventHandler * | handler | ) |
void network::InitiationDispatcher::removeHandler | ( | int | fd | ) |
void network::InitiationDispatcher::requestShutdown | ( | ) |
|
private |
|
private |