Skip to content

Commit 23628e3

Browse files
committed
Optimizations
- `send()` optimization: for non-cancellable tasks, synchronously return the future when the channel is already up and running. Otherwise, return the result asynchronously via `ForwardCompleter`. - Use `Stopwatch` instead of `Timestamp` for worker stats. - Improved tests.
1 parent 4c07966 commit 23628e3

102 files changed

Lines changed: 16223 additions & 22680 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ Squadron is a multi-threading library for Dart and Flutter. It provides a unifie
3434

3535
## Testing & Verification (CRITICAL)
3636
- **Recompilation**: Any change to code that is **imported by the worker binaries** requires recompilation of the test artifacts in `test/workers/`.
37-
- **Triggers**: Changes to `WorkerService`, `Channel`, `WorkerRequest`, `WorkerResponse`, and **any logic in `_impl/`** that is used by workers (even platform-specific web/native implementations).
38-
- **No Recompile Needed**: Changes to client-side orchestration like the `Worker` class proxy, `WorkerPool`, or startup logic.
39-
- **Canonical Test Command**: Use `.\tool\run_tests.bat /b`.
40-
- The `/b` flag triggers `tool/compile_tests.dart` which generates the `.js` and `.wasm` files required for web tests.
41-
- **NEVER** rely solely on `dart test` after modifying core library code, as it will run web tests against stale worker binaries.
42-
- **Sequential Execution**: Tests are run with `-j 1` to avoid race conditions and resource exhaustion during worker process spawning.
37+
- **Triggers**: Changes to (but not limited to) `WorkerService`, `Channel`, `WorkerRequest`, `WorkerResponse`, and **any logic in `_impl/`** that is used by workers (including platform-specific Web implementations).
38+
- **No Recompile Needed**: Changes to client-side orchestration like the `Worker` class proxy, `WorkerPool`, or startup logic. Compilation is required on Web platforms only; native platforms do not require recompilation.
39+
- **Canonical Test Command**: **ALWAYS** use `.\tool\run_tests.bat` (Windows) or `./tool/run_tests.sh` (Linux).
40+
- Use the `/b` (or `-b`) flag to trigger `tool/compile_tests.dart`, which generates the `.js` and `.wasm` files required for web tests.
41+
- Additional arguments (e.g., `--name "some test"`) are passed directly to `dart test`.
42+
- **NEVER** run `dart test` directly after modifying core library code, as it will run web tests against stale worker binaries.
43+
- **Sequential Execution**: Tests are run with `-j 1` by the scripts to avoid race conditions and resource exhaustion during worker process spawning.
4344

4445
## Cancellation Logic
4546
- **CancellationToken**: Based on the `cancelation_token` package.

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 7.4.2
2+
3+
- `send()` optimization: for non-cancellable tasks, synchronously return the future when the channel is already up and running. Otherwise, return the result asynchronously via `ForwardCompleter`.
4+
- Use `Stopwatch` instead of `Timestamp` for worker stats.
5+
- Improved tests.
6+
17
## 7.4.1
28

39
- Moved log serialization into the `WorkerResponse.wrapInPlace` method.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<span><b>JavaScript Workers</b> compiled on <b>2026-03-04 23:45:45 GMT</b></span>
1+
<span><b>JavaScript Workers</b> compiled on <b>2026-03-21 17:17:45 GMT</b></span>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<span><b>Test Console</b> compiled on <b>2026-03-04 23:45:45 GMT</b></span>
1+
<span><b>Test Console</b> compiled on <b>2026-03-21 17:17:45 GMT</b></span>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<span><b>Web Assembly Workers</b> compiled on <b>2026-03-04 23:45:45 GMT</b></span>
1+
<span><b>Web Assembly Workers</b> compiled on <b>2026-03-21 17:17:45 GMT</b></span>

0 commit comments

Comments
 (0)