Orbit Framework
An ultra-modern, asynchronous, cross-platform C++ Web Framework.
Loading...
Searching...
No Matches
EventLoop.hpp
Go to the documentation of this file.
1
#pragma once
2
#include <
orbit/network/Proactor.hpp
>
3
#include <
orbit/server/Listener.hpp
>
4
#include <
orbit/routing/Router.hpp
>
5
#include <
orbit/server/ConnectionManager.hpp
>
6
#include <
orbit/concurrency/ThreadPool.hpp
>
7
#include <
orbit/server/TimerManager.hpp
>
8
#include <
orbit/config/Config.hpp
>
9
#include <
orbit/network/TlsContext.hpp
>
10
#include <
orbit/network/UdpSocket.hpp
>
11
#ifdef ORBIT_ENABLE_HTTP3
12
#include <
orbit/server/QuicConnectionManager.hpp
>
13
#else
14
namespace
server
{
class
QuicConnectionManager; }
15
#endif
16
#include <atomic>
17
18
namespace
server
{
19
23
class
EventLoop
{
24
public
:
34
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
);
35
44
void
run
();
45
49
void
stop
();
50
54
void
stop_accepting
();
55
60
concurrency::ThreadPool
&
get_thread_pool
() {
return
thread_pool_; }
61
62
private
:
63
void
do_accept();
64
void
do_read_quic();
65
66
Listener
& listener_;
67
TimerManager
timer_manager_;
68
std::unique_ptr<network::Proactor> proactor_;
69
concurrency::ThreadPool
thread_pool_;
70
ConnectionManager
connection_manager_;
71
network::UdpSocket
* quic_socket_;
72
QuicConnectionManager
* quic_manager_;
73
74
75
std::atomic<bool> is_running_{
true
};
76
std::atomic<bool> is_accepting_{
true
};
77
};
78
79
}
// namespace server
Config.hpp
ConnectionManager.hpp
Listener.hpp
Proactor.hpp
QuicConnectionManager.hpp
Router.hpp
ThreadPool.hpp
TimerManager.hpp
TlsContext.hpp
UdpSocket.hpp
concurrency::ThreadPool
Definition
ThreadPool.hpp:12
network::TlsContext
Definition
TlsContext.hpp:10
network::UdpSocket
Definition
UdpSocket.hpp:7
routing::Router
Manages routing of HTTP requests to their appropriate handlers.
Definition
Router.hpp:30
server::ConnectionManager
Manages active HTTP connections.
Definition
ConnectionManager.hpp:17
server::EventLoop
Manages the server's event loop, handling I/O operations and dispatching tasks.
Definition
EventLoop.hpp:23
server::EventLoop::get_thread_pool
concurrency::ThreadPool & get_thread_pool()
Gets the thread pool.
Definition
EventLoop.hpp:60
server::EventLoop::stop_accepting
void stop_accepting()
Stops accepting new connections but continues processing existing ones.
Definition
EventLoop.cpp:73
server::EventLoop::run
void run()
Starts the event loop.
Definition
EventLoop.cpp:45
server::EventLoop::stop
void stop()
Stops the event loop.
Definition
EventLoop.cpp:69
server::Listener
Listens for incoming network connections.
Definition
Listener.hpp:11
server::QuicConnectionManager
Manages QUIC connections.
Definition
QuicConnectionManager.hpp:36
server::TimerManager
Manages timers for connection timeouts.
Definition
TimerManager.hpp:29
config
Definition
Config.hpp:5
server
Definition
Http2Session.hpp:17
config::ServerConfig
Definition
Config.hpp:18
include
orbit
server
EventLoop.hpp
Generated by
1.9.8