UiDispatcher

Pairs a CommandQueue!T with a target window. post enqueues a command and wakes the UI thread with PostMessageW; the window's WndProc responds to the wake message by calling drain and processing the result.

Constructors

this
this(HWND hwnd, uint messageId)

Create a dispatcher targeting hwnd, with a fresh backing queue. messageId is the wake message posted to the window on post (defaults to defaultWakeMessage).

Members

Functions

drain
T[] drain()

Remove and return all queued commands. Call on the UI thread.

post
void post(T command)

Enqueue a command and wake the target window.

Variables

messageId
uint messageId;

The wake message id posted to targetHwnd.

queue
CommandQueue!T queue;

The backing queue (shared; reference type).

targetHwnd
HWND targetHwnd;

The window woken on post.

Meta