Manager¶
DtolManager owns a named collection of tasks on one or more boards, polls
them concurrently, and coordinates simultaneous starts. See the
Manager guide and Synchronized start.
dtollib.manager ¶
DtolManager — orchestrates many tasks across one or more DT boards.
Per-board lock + HDRVR ref-count sharing + poll(names=...) fan-out
aggregation + start_synchronized for coordinated single-board starts.
Continuous acquisition is owned by :func:dtollib.streaming.record, which
takes a single :class:DtolSession; the manager does not aggregate streams.
Design reference: docs/design.md §16.
DeviceResult
dataclass
¶
Outcome of a per-device call under :attr:ErrorPolicy.RETURN.
Exactly one of :attr:value / :attr:error is populated.
DtolManager ¶
Orchestrate many :class:DtolSessions.
- :meth:
add/ :meth:remove/ :meth:get— registry. - :meth:
poll(names)— fan-out polling that returns one :class:DeviceResultper requested task. - :meth:
start(names)/ :meth:stop(names)— bulk lifecycle. - :meth:
start_synchronized(names)— coordinated single-board start via the SDK simultaneous-start primitives.
Thread safety: one anyio.Lock per board (HDRVR), shared by
every session against that board. Concurrent polls across
different boards run in parallel; same-board concurrency
serialises. See docs/design.md §16.3.
Source code in src/dtollib/manager.py
__aenter__
async
¶
__aexit__
async
¶
Close every managed session on exit.
aclose
async
¶
Close every managed session.
Source code in src/dtollib/manager.py
add
async
¶
Register a task by name; reserve its subsystem; return its session.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Manager-level identifier; becomes the join key in aggregated results. Must be unique. |
required |
spec
|
TaskSpec
|
The :class: |
required |
backend
|
DtolBackend | None
|
Optional explicit backend. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
DtolSession
|
class: |
DtolSession
|
|
|
DtolSession
|
meth: |
Raises:
| Type | Description |
|---|---|
DtolValidationError
|
A task with |
DtolResourceError
|
The |
Source code in src/dtollib/manager.py
get ¶
Return the session registered under name.
Source code in src/dtollib/manager.py
poll
async
¶
Poll each named task; aggregate :class:DaqReading results.
Same-board polls serialise on the per-board lock; cross-board
polls run in parallel via :class:anyio.create_task_group.
Source code in src/dtollib/manager.py
remove
async
¶
Close and unregister the named task.
Source code in src/dtollib/manager.py
start
async
¶
Start each named task. Aggregates per-task outcomes.
start_synchronized
async
¶
Start the named tasks together via the SDK simultaneous-start primitives.
Runs the four-step DT-Open Layers sequence (docs/design.md §16.2):
olDaGetSSList → olDaPutDassToSSList × N →
olDaSimultaneousPreStart → olDaSimultaneousStart, then always
olDaReleaseSSList. The first samples of every named subsystem then
begin within one sample period of each other.
Scope is single-board: every named task must target the same
board and share one backend instance (so they share the HDRVR
namespace the SS-list is built from). Cross-board sync-bus
coordination is not supported. Each task must already be committed —
the manager commits during :meth:add, so single-value and counter
tasks satisfy this directly; continuous-AI tasks must complete their
record() register→queue→commit sequence (with autostart=False)
before calling this.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
names
|
Sequence[str]
|
Task names to start together. Must be non-empty and all on one board / one backend. |
required |
Raises:
| Type | Description |
|---|---|
DtolValidationError
|
Unknown name, empty list, or tasks span multiple boards or backends. |
Source code in src/dtollib/manager.py
stop
async
¶
Stop each named task. Aggregates per-task outcomes.
ErrorPolicy ¶
Bases: StrEnum
How a recorder reacts to a backend error mid-stream.
Attributes:
| Name | Type | Description |
|---|---|---|
RAISE |
Cancel the recorder; the exception propagates out of the
|
|
RETURN |
Emit a payload with |
|
SKIP |
Drop the failed payload silently. Increments
|