Qore AsyncSocketIo Module Reference 2.0
Loading...
Searching...
No Matches

AsyncSocketIo Module Introduction

The AsyncSocketIo module provides an API for async socket I/O.

To use this module, use "%requires AsyncSocketIo" in your code.

All the public symbols in the module are defined in the AsyncSocketIo namespace.

Release Notes

AsyncSocketIo 1.0

Internal Design

This module provides a shared async socket I/O controller used by HttpServerAsyncIo and other components. The controller owns an I/O thread that blocks in Socket::poll() over a list of socket poll items. A pipe is used as a control signal to wake the poll loop when commands are enqueued. Commands are queued under a controller lock and processed in the I/O thread; completed operations are reported back to a coordinator thread for higher-level handling.

Key concepts:

  • The controller manages SocketPollOperation instances representing accepts and I/O work.
  • A control pipe is always pollable so the I/O thread can be woken for new commands or shutdown.
  • The command queue and control pipe are coordinated to avoid lost wakeups.
  • Results are pushed to a result queue processed by the coordinator thread.

Consumers should not touch internal queues directly. All interaction must go through the controller API and must respect the documented locking requirements.