Configuration¶
DtolConfig is the immutable settings object; config_from_env builds one
from DTOLLIB_* environment variables. See the
Configuration guide.
dtollib.config ¶
Process-wide configuration for :mod:dtollib.
Plain frozen dataclass, no validation library — keeps the core install free
of optional deps. Env-var coercion lives in :func:config_from_env.
Design reference: docs/design.md §19.1.
DtolConfig
dataclass
¶
DtolConfig(
*,
default_timeout_s=10.0,
default_sample_rate_hz=1000.0,
default_chunk_size=1000,
default_buffers=4,
default_stream_buffer=16,
eager_tasks=False,
oldaapi_dll_path=None,
olmem_dll_path=None,
)
Process-wide default settings.
Anything that varies per task (channel ranges, trigger source,
buffer plan) belongs on :class:~dtollib.tasks.TaskSpec, not here.
Attributes:
| Name | Type | Description |
|---|---|---|
default_timeout_s |
float
|
Fallback SDK read/write timeout, in seconds. Used when the call site does not supply one explicitly. |
default_sample_rate_hz |
float
|
Fallback |
default_chunk_size |
int
|
Samples per channel per emitted |
default_buffers |
int
|
|
default_stream_buffer |
int
|
AnyIO send-stream capacity for |
eager_tasks |
bool
|
Opt-in to |
oldaapi_dll_path |
str | None
|
Explicit override for the |
olmem_dll_path |
str | None
|
Explicit override for the |
config_from_env ¶
Best-effort env loader.
Only reads well-known keys. Missing or unparseable values fall back to
:class:DtolConfig's defaults — this function never raises.
Recognised keys (with prefix="DTOLLIB_"):
DTOLLIB_DEFAULT_TIMEOUT_S— float secondsDTOLLIB_DEFAULT_SAMPLE_RATE_HZ— float HzDTOLLIB_DEFAULT_CHUNK_SIZE— int samplesDTOLLIB_DEFAULT_BUFFERS— int (clamped at 3 byBufferPlan; stored verbatim here)DTOLLIB_DEFAULT_STREAM_BUFFER— int slotsDTOLLIB_EAGER_TASKS—"1"/"true"/"yes"DTOLLIB_OLDAAPI_DLL— explicitoldaapi*.dllpathDTOLLIB_OLMEM_DLL— explicitolmem*.dllpath
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
prefix
|
str
|
Prefix to prepend to each env key. Defaults to
|
DEFAULT_ENV_PREFIX
|
Returns:
| Name | Type | Description |
|---|---|---|
A |
DtolConfig
|
class: |