You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: Add uv/mdformat tooling and format all documentation
- Add pyproject.toml with docs and dev dependency groups
- Add uv.lock for reproducible environments
- Configure mdformat with mkdocs, tables, frontmatter, and config plugins
- Format all 73 markdown files with mdformat
- Update .gitignore for .venv/ and site/
- Update contributing docs to reference uv workflow
| Scope | In-process (+ network)| Distributed by default |
149
+
| Real-time | Designed for it | Possible (DDS)|
150
150
151
151
NUClear is intentionally focused on **in-process concurrency** with optional networking, rather than being a distributed middleware. This keeps it lightweight and predictable — exactly what you want when reactions need to complete in microseconds.
Copy file name to clipboardExpand all lines: docs/explanation/dsl-system.md
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ This single statement does a lot. Let's break it apart.
38
38
39
39
## Phase 2: Template Instantiation — `on<>()`
40
40
41
-
When you call `on<`[`Trigger`](../reference/dsl/trigger.md)`<T>, `[`Sync`](../reference/dsl/sync.md)`<G>>()`, the Reactor base class constructs a `Binder`:
41
+
When you call `on<Trigger<T>, Sync<G>>()`, the Reactor base class constructs a `Binder`:
42
42
43
43
```cpp
44
44
template <typename... DSL, typename... Arguments>
@@ -56,9 +56,9 @@ The key type here is `dsl::Parse<Trigger<T>, Sync<G>>` — this is the "fused" D
56
56
When `.then()` is called, several things happen in sequence:
57
57
58
58
1. **CallbackGenerator created** — wraps your lambda with the DSL's get/precondition/scope logic
59
-
2. **Reaction object created** — stores the generator, identifiers, and reactor reference
60
-
3. **`DSL::bind(reaction)` called** — each word registers itself (e.g., Trigger adds to TypeCallbackStore)
61
-
4. **ReactionHandle returned** — lets you enable/disable the reaction later
59
+
1. **Reaction object created** — stores the generator, identifiers, and reactor reference
60
+
1. **`DSL::bind(reaction)` called** — each word registers itself (e.g., Trigger adds to TypeCallbackStore)
61
+
1. **ReactionHandle returned** — lets you enable/disable the reaction later
62
62
63
63
```cpp
64
64
auto reaction = std::make_shared<threading::Reaction>(
1. Stores the data in the global `DataStore<SensorData>`
106
-
2. Sets `ThreadStore<SensorData>` (thread-local pointer) to the new data
107
-
3. Looks up `TypeCallbackStore<SensorData>` for all registered reactions
108
-
4. For each reaction: calls `reaction->get_task()` to create a task
106
+
1. Sets `ThreadStore<SensorData>` (thread-local pointer) to the new data
107
+
1. Looks up `TypeCallbackStore<SensorData>` for all registered reactions
108
+
1. For each reaction: calls `reaction->get_task()` to create a task
109
109
110
110
## Phase 6: Task Creation — CallbackGenerator
111
111
@@ -127,9 +127,9 @@ The `CallbackGenerator` does this in order:
127
127
128
128
1.**Creates a ReactionTask** with priority, inline preference, pool, and group functions
129
129
1.**Checks precondition** — if false, task is dropped (e.g., [`Single`](../reference/dsl/single.md) blocks if already running)
130
-
3.**Calls `DSL::get()`** — reads the data from ThreadStore (freshest) or DataStore (latest)
131
-
4.**Checks data validity** — if any required data is null, task is dropped
132
-
5.**Captures the callback** — binds the data into a closure stored on the task
130
+
1.**Calls `DSL::get()`** — reads the data from ThreadStore (freshest) or DataStore (latest)
131
+
1.**Checks data validity** — if any required data is null, task is dropped
132
+
1.**Captures the callback** — binds the data into a closure stored on the task
133
133
134
134
## Phase 7: Task Submitted
135
135
@@ -184,7 +184,7 @@ flowchart TD
184
184
185
185
The DSL uses several layers of compile-time machinery:
186
186
187
-
### Parse<Words...>
187
+
### Parse\<Words...>
188
188
189
189
`Parse` is the entry point. It creates `Fusion<Words...>` and delegates each operation (bind, get, group, pool, priority, etc.) to the fusion, falling back to a `NoOp` if no word implements that operation.
0 commit comments