|
| io_handler ()=default |
| Default constructor.
|
| ~io_handler ()=default |
| Default destructor.
|
session_map_t & | sessions () |
| Get the map of active sessions.
|
std::shared_ptr< _Session > | session (uuid id) |
| Get a session by its UUID.
|
template<typename... Args> |
_Session & | registerSession (typename _Session::transport_io_type &&new_io, Args &&...args) |
| Register a new session.
|
void | unregisterSession (uuid const &ident) |
| Unregister a session.
|
std::pair< typename _Session::transport_io_type, bool > | extractSession (uuid const &ident) |
| Extract a session's IO object.
|
template<typename... _Args> |
_Derived & | stream (_Args &&...args) |
| Broadcast data to all sessions.
|
template<typename _Func, typename... _Args> |
_Derived & | stream_if (_Func const &func, _Args &&...args) |
| Broadcast data to selected sessions.
|
template<typename _Derived, typename _Session>
class qb::io::async::io_handler< _Derived, _Session >
Session manager for asynchronous IO.
This template class manages sessions for asynchronous IO operations. It provides methods for registering, tracking, and unregistering sessions, as well as utilities for broadcasting data to all or selected sessions.
- Template Parameters
-
_Derived | The derived class type (CRTP pattern) |
_Session | The session class type |
template<typename _Derived, typename _Session>
template<typename _Func, typename... _Args>
Broadcast data to selected sessions.
Sends the provided data to sessions that match the given predicate.
- Template Parameters
-
_Func | Type of the selection predicate |
_Args | Types of data to send |
- Parameters
-
func | Predicate to select sessions to receive the data |
args | Data to send to selected sessions |
- Returns
- Reference to the derived object for method chaining