Skip to main content

Module executor

Module executor 

Source
Expand description

The bespoke single-threaded executor (design-doc §4.2/§4.3).

Port of cocotb’s event loop + Task model: a run queue drained to exhaustion after every simulator callback (cocotb: _event_loop.py, EventLoop.run), tasks with the same seven observable states (cocotb: task.py, _TaskState), and drop-based cancellation (§4.6).

Structs§

Executor
The executor (design-doc §4.3). !Send — it never leaves the sim thread.
TaskHandle
Public task control surface; also a Future (handle.await == awaiting completion, as in cocotb 2.x). Port of cocotb Task (design-doc §4.3).

Enums§

TaskError
TaskState
The seven task states, per cocotb (mapping row 5).

Functions§

current
The thread’s executor. Panics if init() has not run.
init
Create and install a fresh executor on this thread.
spawn
Port of cocotb.start_soon (mapping row 4).
spawn_named

Type Aliases§

TaskId