Lightweight 0.20260617.0
Loading...
Searching...
No Matches
Lightweight::Async::IAsyncBackend Class Referenceabstract

#include <Backend.hpp>

Inheritance diagram for Lightweight::Async::IAsyncBackend:
Lightweight::Async::ThreadOffloadBackend

Public Member Functions

 IAsyncBackend (IAsyncBackend const &)=delete
 
IAsyncBackendoperator= (IAsyncBackend const &)=delete
 
 IAsyncBackend (IAsyncBackend &&)=delete
 
IAsyncBackendoperator= (IAsyncBackend &&)=delete
 
virtual StrandExecutorStrand () noexcept=0
 
virtual IResumeSchedulerResumeScheduler () noexcept=0
 

Detailed Description

Per-connection asynchronous execution backend.

A backend owns (or references) the execution context used to run a connection's blocking ODBC work and to resume the awaiting coroutine. Currently the only implementation is ThreadOffloadBackend (portable; offloads to a worker thread). A native event backend (Windows + SQL Server) is planned behind this same interface.

The backend is selected once per connection (see SqlConnection::EnableAsync) and used by all of that connection's async methods.

Definition at line 23 of file Backend.hpp.

Member Function Documentation

◆ Strand()

virtual StrandExecutor & Lightweight::Async::IAsyncBackend::Strand ( )
pure virtualnoexcept

The serializing executor for this connection; blocking work is offloaded here so the connection's ODBC handle is only ever touched by one thread at a time.

Implemented in Lightweight::Async::ThreadOffloadBackend.

◆ ResumeScheduler()

virtual IResumeScheduler & Lightweight::Async::IAsyncBackend::ResumeScheduler ( )
pure virtualnoexcept

The scheduler used to resume coroutines after a blocking step completes (typically the application's run loop).

Implemented in Lightweight::Async::ThreadOffloadBackend.


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