IntentQueue Type
The intent queue of an adaptive program: the single place to post
unit -> unit work during Update. Intents are work items deferred
to a moment the runtime owns, exposed as moment-named entry points:
IntentQueue.post (later in this step),
IntentQueue.postNextFrame (top of the next
step), and IntentQueue.postTask /
IntentQueue.postAsync (background work whose
completion returns via post). The adaptive counterpart of Cmd
— closures capture the handler, so no message type is needed.
All three lanes are multi-producer, single-consumer queues: a
ConcurrentQueue for
producers, drained by the single consumer (the runner) on the
owner thread. The post drain runs until empty — work posted during the
drain runs in the same drain, in post order, mirroring MVU's
DispatchMode.Immediate semantics; work that posts more work is the
user's responsibility, exactly as message cycles are in MVU. The first
post drain is the startup drain: it runs right after Init returns,
before the first frame is forced, so work Init posted through its
context lands before the first frame. The pre-step lane holds
subscription events and drains once per Step
at the boundary, before Update; the next-frame lane also drains
once per Step at the boundary, never per sub-step.
Allocation: one queue node per posted work item — acceptable on the cold
path, zero on steps with no posted work.
Constructors
| Constructor |
Description
|
|
|
Instance members
| Instance member |
Description
|
Full Usage:
this.post work
Parameters:
unit -> unit
-
The work to run at the post drain.
|
Defers
|
Full Usage:
this.postAsync (work, ofSuccess, ofError)
Parameters:
Async<'T>
-
The async workflow to start; must not touch the graph.
ofSuccess : 'T -> unit
-
Receives the result on the owner thread at a later post drain.
ofError : exn -> unit
-
Receives the exception on the owner thread at a later post drain.
Type parameters: 'T |
Defers an F# async workflow to this queue: the starter runs on the
owner thread at the next post drain and starts the workflow on the
thread pool — the workflow body runs off the owner thread — and the
completion (
|
Full Usage:
this.postNextFrame work
Parameters:
unit -> unit
-
The work to run at the next step's boundary.
|
Defers
|
Full Usage:
this.postTask (work, ofSuccess, ofError)
Parameters:
unit -> Task<'T>
-
The background work to start; must not touch the graph.
ofSuccess : 'T -> unit
-
Receives the result on the owner thread at a later post drain.
ofError : exn -> unit
-
Receives the exception on the owner thread at a later post drain.
Type parameters: 'T |
Defers a background task to this queue: the starter runs on the
owner thread at the next post drain and hands the work to the
thread pool —
|
Mibo