Orbit Framework
An ultra-modern, asynchronous, cross-platform C++ Web Framework.
Loading...
Searching...
No Matches
server::EventLoop Class Reference

Manages the server's event loop, handling I/O operations and dispatching tasks. More...

#include <EventLoop.hpp>

Public Member Functions

 EventLoop (Listener &listener, const routing::Router &router, const config::ServerConfig &config, network::TlsContext *tls_context=nullptr, network::UdpSocket *quic_socket=nullptr, QuicConnectionManager *quic_manager=nullptr)
 Constructs an EventLoop.
 
void run ()
 Starts the event loop.
 
void stop ()
 Stops the event loop.
 
void stop_accepting ()
 Stops accepting new connections but continues processing existing ones.
 
concurrency::ThreadPoolget_thread_pool ()
 Gets the thread pool.
 

Detailed Description

Manages the server's event loop, handling I/O operations and dispatching tasks.

Constructor & Destructor Documentation

◆ EventLoop()

server::EventLoop::EventLoop ( Listener listener,
const routing::Router router,
const config::ServerConfig config,
network::TlsContext tls_context = nullptr,
network::UdpSocket quic_socket = nullptr,
QuicConnectionManager quic_manager = nullptr 
)

Constructs an EventLoop.

Parameters
listenerThe server listener.
routerThe router instance.
configThe server configuration.
tls_contextThe TLS context (optional).
quic_socketThe QUIC UDP socket (optional).
quic_managerThe QUIC connection manager (optional).

Member Function Documentation

◆ get_thread_pool()

concurrency::ThreadPool & server::EventLoop::get_thread_pool ( )
inline

Gets the thread pool.

Returns
Reference to the thread pool.

◆ run()

void server::EventLoop::run ( )

Starts the event loop.

EventLoop loop(listener, router, config);
loop.run();
Manages the server's event loop, handling I/O operations and dispatching tasks.
Definition EventLoop.hpp:23
Definition Config.hpp:5

◆ stop()

void server::EventLoop::stop ( )

Stops the event loop.

◆ stop_accepting()

void server::EventLoop::stop_accepting ( )

Stops accepting new connections but continues processing existing ones.


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