Skip to content

Commit 694b113

Browse files
maryamshalparlough
andauthored
Update isolates.md: Robust Example Fix (#5725)
Fix robust example inconsistency. The constructor signature changes order of parameters mid example which causes issues for a person following along step by step. --------- Co-authored-by: Parker Lougheed <parlough@gmail.com>
1 parent 7c8e5d7 commit 694b113

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

examples/concurrency/lib/robust_ports_example/spawn_1.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Worker {
3030
_commands.send(message);
3131
}
3232

33-
Worker._(this._commands, this._responses) {
33+
Worker._(this._responses, this._commands) {
3434
// TODO: Initialize main isolate receive port listener.
3535
}
3636

examples/concurrency/lib/robust_ports_example/spawn_2.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Worker {
3030
final (ReceivePort receivePort, SendPort sendPort) =
3131
await connection.future;
3232

33-
return Worker._(sendPort, receivePort);
33+
return Worker._(receivePort, sendPort);
3434
}
3535
// #enddocregion worker-spawn
3636

@@ -39,7 +39,7 @@ class Worker {
3939
_commands.send(message);
4040
}
4141

42-
Worker._(this._commands, this._responses) {
42+
Worker._(this._responses, this._commands) {
4343
// TODO: Initialize main isolate receive port listener.
4444
}
4545

examples/concurrency/lib/robust_ports_example/start.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Worker {
1818
throw UnimplementedError();
1919
}
2020

21-
Worker._(this._commands, this._responses) {
21+
Worker._(this._responses, this._commands) {
2222
// TODO: Initialize main isolate receive port listener.
2323
}
2424

src/content/language/isolates.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ class Worker {
560560
throw UnimplementedError();
561561
}
562562
563-
Worker._(this._commands, this._responses) {
563+
Worker._(this._responses, this._commands) {
564564
// TODO: Initialize main isolate receive port listener.
565565
}
566566
@@ -689,7 +689,7 @@ class Worker {
689689
final (ReceivePort receivePort, SendPort sendPort) =
690690
await connection.future;
691691
692-
return Worker._(sendPort, receivePort);
692+
return Worker._(receivePort, sendPort);
693693
}
694694
```
695695

0 commit comments

Comments
 (0)