Condy v1.5.0
C++ Asynchronous System Call Layer for Linux
Loading...
Searching...
No Matches
condy::Runtime Class Reference

The event loop runtime for executing asynchronous. More...

#include <runtime.hpp>

Public Member Functions

 Runtime (const RuntimeOptions &options={})
 Construct a new Runtime object.
void allow_exit () noexcept
 Allow the runtime to exit when there are no pending works.
void run () noexcept
 Run the runtime event loop in the current thread.
auto & fd_table () noexcept
 Get the file descriptor table of the runtime.
auto & buffer_table () noexcept
 Get the buffer table of the runtime.
auto & settings () noexcept
 Get the ring settings of the runtime.

Detailed Description

The event loop runtime for executing asynchronous.

This class provides a single-threaded runtime for executing asynchronous tasks using io_uring. It manages the event loop, scheduling, and execution of tasks, as well as inter-runtime notifications.

Definition at line 68 of file runtime.hpp.

Constructor & Destructor Documentation

◆ Runtime()

condy::Runtime::Runtime ( const RuntimeOptions & options = {})
inline

Construct a new Runtime object.

Parameters
optionsOptions for configuring the runtime.

Definition at line 74 of file runtime.hpp.

Member Function Documentation

◆ allow_exit()

void condy::Runtime::allow_exit ( )
inlinenoexcept

Allow the runtime to exit when there are no pending works.

By default, the runtime will keep running even if there are no pending works. Calling this function will allow the runtime to exit once all pending works are completed.

Note
This function is thread-safe and can be called from any thread.

Definition at line 176 of file runtime.hpp.

◆ buffer_table()

auto & condy::Runtime::buffer_table ( )
inlinenoexcept

Get the buffer table of the runtime.

Returns
BufferTable& Reference to the buffer table of the runtime.

Definition at line 276 of file runtime.hpp.

◆ fd_table()

auto & condy::Runtime::fd_table ( )
inlinenoexcept

Get the file descriptor table of the runtime.

Returns
FdTable& Reference to the fd table of the runtime.

Definition at line 270 of file runtime.hpp.

◆ run()

void condy::Runtime::run ( )
inlinenoexcept

Run the runtime event loop in the current thread.

This function starts the event loop of the runtime in the current thread. It will process events, schedule tasks, and handle notifications until there are no pending works left.

Note
Once exit, the runtime cannot be restarted.

Definition at line 220 of file runtime.hpp.

◆ settings()

auto & condy::Runtime::settings ( )
inlinenoexcept

Get the ring settings of the runtime.

Returns
RingSettings& Reference to the ring settings of the runtime.

Definition at line 282 of file runtime.hpp.


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