Singleton worker that manages asynchronous WebSocket operations.
More...
#include <SimpleWebSocketWorker.hpp>
|
std::shared_ptr< SimpleWeb::io_context > | get_io_context () |
| Provides access to the I/O context for WebSocket operations.
|
|
void | notify () |
| Notifies the worker to check for pending tasks.
|
|
void | start () |
| Starts the worker thread if it is not already running.
|
|
void | stop () |
| Stops the worker thread and waits for it to finish.
|
|
|
using | work_guard_t = boost::asio::executor_work_guard<boost::asio::io_context::executor_type> |
|
using | io_context_t = std::shared_ptr<SimpleWeb::io_context> |
|
Singleton worker that manages asynchronous WebSocket operations.
Definition at line 12 of file SimpleWebSocketWorker.hpp.
◆ io_context_t
◆ work_guard_t
◆ SimpleWebSocketWorker() [1/2]
kurlyk::SimpleWebSocketWorker::SimpleWebSocketWorker |
( |
| ) |
|
|
inlineprivate |
◆ ~SimpleWebSocketWorker()
kurlyk::SimpleWebSocketWorker::~SimpleWebSocketWorker |
( |
| ) |
|
|
inlineprivate |
◆ SimpleWebSocketWorker() [2/2]
◆ get_instance()
◆ get_io_context()
std::shared_ptr< SimpleWeb::io_context > kurlyk::SimpleWebSocketWorker::get_io_context |
( |
| ) |
|
|
inline |
Provides access to the I/O context for WebSocket operations.
- Returns
- Shared pointer to the I/O context.
Definition at line 24 of file SimpleWebSocketWorker.hpp.
◆ notify()
void kurlyk::SimpleWebSocketWorker::notify |
( |
| ) |
|
|
inline |
◆ operator=()
◆ start()
void kurlyk::SimpleWebSocketWorker::start |
( |
| ) |
|
|
inline |
◆ stop()
void kurlyk::SimpleWebSocketWorker::stop |
( |
| ) |
|
|
inline |
◆ m_future
std::shared_future<void> kurlyk::SimpleWebSocketWorker::m_future |
|
private |
◆ m_io_context
◆ m_is_worker_started
bool kurlyk::SimpleWebSocketWorker::m_is_worker_started = false |
|
private |
◆ m_is_worker_started_mutex
std::mutex kurlyk::SimpleWebSocketWorker::m_is_worker_started_mutex |
|
private |
◆ m_notify
bool kurlyk::SimpleWebSocketWorker::m_notify = false |
|
private |
◆ m_notify_condition
std::condition_variable kurlyk::SimpleWebSocketWorker::m_notify_condition |
|
private |
◆ m_notify_mutex
std::mutex kurlyk::SimpleWebSocketWorker::m_notify_mutex |
|
private |
◆ m_shutdown
std::atomic<bool> kurlyk::SimpleWebSocketWorker::m_shutdown = ATOMIC_VAR_INIT(false) |
|
private |
◆ m_work_guard
The documentation for this class was generated from the following file: