Preliminary. ThinkMeta ConcurrentTasks and this documentation are preliminary; everything is subject to change.

API reference / Async I/O

Functions and constants functions

Free functions and constants of Async I/O.

On this page
Use
import ThinkMeta.ConcurrentTasks.AsyncIo.AsyncFileIoRequest;
Namespace
ThinkMeta::ConcurrentTasks::AsyncIo
Platforms
Windows, Linux

Functions

AsyncIo::AsyncIoRequestCompleted

Windows only

The completion routine for handles whose operations use AsyncIoRequestBase requests.

Syntax

inline void AsyncIoRequestCompleted(
    OVERLAPPED* overlapped,
    DWORD error,
    DWORD bytesTransferred
) noexcept;

Parameters

overlappedOVERLAPPED*
The completed operation's OVERLAPPED; must belong to an AsyncIoRequestBase.
errorDWORD
The operation's Win32 error code; ERROR_SUCCESS when it succeeded.
bytesTransferredDWORD
Bytes the operation transferred.

Remarks

Pass it as the IoCompletionRoutine (see Core.h) to AssociateHandleWithIoCompletionPort. Runs on the core's I/O thread and calls the request's AsyncIoRequestBase::RequestCompleted with the operation's own error code. Every OVERLAPPED issued on such a handle must belong to an AsyncIoRequestBase.

See also

EnableAsyncIo

Linux only

The completion routine of every IoRequest that belongs to an AsyncIoRequestBase.

Syntax

inline void AsyncIoRequestCompleted(
    IoRequest* request,
    std::int32_t result
) noexcept;

Parameters

requestIoRequest*
The completed operation's IoRequest; must belong to an AsyncIoRequestBase.
resultstd::int32_t
What the core reports: the bytes transferred, or the negated errno.

Remarks

Store it in IoRequest::routine before SubmitIo. Runs on the core's I/O thread and calls the request's AsyncIoRequestBase::RequestCompleted with the errno (0 on success) and the bytes transferred.

See also

EnableAsyncIo

Concepts

AsyncIo::WaitableAsyncFileIoRequestType

Satisfied by the two waitable file request variants.

Syntax

template <typename T>
concept WaitableAsyncFileIoRequestType =
    std::same_as<T, WaitableAsyncFileIoRequest>
    || std::same_as<T, WaitableAsyncFileIoRequest_s>;

Template parameters

Ttypename
The type to test: WaitableAsyncFileIoRequest or WaitableAsyncFileIoRequest_s.

See also

WaitableAsyncFileIoRequest, WaitableAsyncFileIoRequest_s

AsyncIo::AsyncSocketIoRequestType

Satisfied by AsyncSocketIoRequest and every class derived from it.

Syntax

template <typename T>
concept AsyncSocketIoRequestType = std::derived_from<T, AsyncSocketIoRequest>;

Template parameters

Ttypename
The type to test.

AsyncIo::WaitableAsyncSocketIoRequestType

Windows only

Satisfied by the two single-waiter request types above.

Syntax

template <typename T>
concept WaitableAsyncSocketIoRequestType =
    std::same_as<T, WaitableAsyncSocketIoRequest_s>
    || std::same_as<T, WaitableAsyncSocketRecvIoRequest_s>;

Template parameters

Ttypename
The type to test: WaitableAsyncSocketIoRequest_s or WaitableAsyncSocketRecvIoRequest_s.

Remarks

Accepted by AsyncSocket's waiting helpers. They wait with a timeout and keep the request in the caller's frame, which only the single-waiter types allow.

Linux only

Satisfied by the single-waiter request type, WaitableAsyncSocketIoRequest_s.

Syntax

template <typename T>
concept WaitableAsyncSocketIoRequestType =
    std::same_as<T, WaitableAsyncSocketIoRequest_s>;

Template parameters

Ttypename
The type to test.

Remarks

Accepted by AsyncSocket's waiting helpers. Outside Windows there is no receive request with result flags (the receives with flags are Windows only).

Generated from ThinkMeta.ConcurrentTasks.API @ c7663c4 (2026-11-19).