join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
join::BasicProactor Class Reference

basic proactor class. More...

#include <proactor.hpp>

Inheritance diagram for join::BasicProactor:
Collaboration diagram for join::BasicProactor:

Public Member Functions

 BasicProactor ()
 initialize the proactor and its I/O backend.
 
 BasicProactor (const BasicProactor &other)=delete
 copy constructor.
 
BasicProactoroperator= (const BasicProactor &other)=delete
 copy assignment operator.
 
 BasicProactor (BasicProactor &&other)=delete
 move constructor.
 
BasicProactoroperator= (BasicProactor &&other)=delete
 move assignment operator.
 
 ~BasicProactor () noexcept
 destroy instance.
 
int submit (IoOperation *op, bool flush=false, bool sync=false) noexcept
 submit an asynchronous operation to the proactor.
 
int cancel (IoOperation *op, bool flush=false, bool sync=false) noexcept
 cancel an in-flight operation.
 
void run ()
 run the event loop (blocking).
 
void stop (bool sync=true) noexcept
 stop the event loop.
 
int mlock () const noexcept
 lock proactor command queue memory in RAM.
 
bool isRunning () const noexcept
 check if the event loop is running.
 
bool isProactorThread () const noexcept
 check if the calling thread is the proactor thread.
 
- Public Member Functions inherited from join::EventHandler
 EventHandler ()=default
 create instance.
 
 EventHandler (const EventHandler &other)=default
 copy constructor.
 
EventHandleroperator= (const EventHandler &other)=default
 copy assignment operator.
 
 EventHandler (EventHandler &&other)=default
 move constructor.
 
EventHandleroperator= (EventHandler &&other)=default
 move assignment operator.
 
virtual ~EventHandler ()=default
 destroy instance.
 

Additional Inherited Members

- Protected Member Functions inherited from join::EventHandler

Detailed Description

basic proactor class.

Constructor & Destructor Documentation

◆ BasicProactor() [1/3]

join::BasicProactor::BasicProactor ( )
inlineexplicit

initialize the proactor and its I/O backend.

MIT License

Copyright (c) 2026 Mathieu Rabine

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

◆ BasicProactor() [2/3]

join::BasicProactor::BasicProactor ( const BasicProactor & other)
delete

copy constructor.

Parameters
otherother object to copy.

◆ BasicProactor() [3/3]

join::BasicProactor::BasicProactor ( BasicProactor && other)
delete

move constructor.

Parameters
otherother object to move.

◆ ~BasicProactor()

join::BasicProactor::~BasicProactor ( )
inlinenoexcept

destroy instance.

Member Function Documentation

◆ cancel()

int join::BasicProactor::cancel ( IoOperation * op,
bool flush = false,
bool sync = false )
inlinenoexcept

cancel an in-flight operation.

Parameters
opoperation to cancel.
flushcall io_uring_submit after pushing the cancel SQE if true (io_uring only).
syncwait for cancellation acknowledgment if true (default: false).
Returns
0 on success, -1 on failure (lastError set).

◆ isProactorThread()

bool join::BasicProactor::isProactorThread ( ) const
inlinenoexcept

check if the calling thread is the proactor thread.

Returns
true if called from the proactor thread.

◆ isRunning()

bool join::BasicProactor::isRunning ( ) const
inlinenoexcept

check if the event loop is running.

Returns
true if the event loop is running.

◆ mlock()

int join::BasicProactor::mlock ( ) const
inlinenoexcept

lock proactor command queue memory in RAM.

Returns
0 on success, -1 on failure.

◆ operator=() [1/2]

BasicProactor & join::BasicProactor::operator= ( BasicProactor && other)
delete

move assignment operator.

Parameters
otherother object to move.
Returns
current object.

◆ operator=() [2/2]

BasicProactor & join::BasicProactor::operator= ( const BasicProactor & other)
delete

copy assignment operator.

Parameters
otherother object to copy.
Returns
current object.

◆ run()

void join::BasicProactor::run ( )
inline

run the event loop (blocking).

◆ stop()

void join::BasicProactor::stop ( bool sync = true)
inlinenoexcept

stop the event loop.

Parameters
syncwait for loop termination if true.

◆ submit()

int join::BasicProactor::submit ( IoOperation * op,
bool flush = false,
bool sync = false )
inlinenoexcept

submit an asynchronous operation to the proactor.

Parameters
opoperation to submit.
flushcall io_uring_submit after pushing the SQE if true (io_uring only).
syncwait for submission acknowledgment if true (default: false).
Returns
0 on success, -1 on failure.

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