Skip to content

Commit 23ffc0e

Browse files
authored
feat: Add debugName parameter to YAJsonIsolate. (#1118)
1 parent d576ecb commit 23ffc0e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

packages/yet_another_json_isolate/lib/src/_isolates_io.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ import 'package:async/async.dart';
88

99
// One instance manages one isolate
1010
class YAJsonIsolate {
11+
YAJsonIsolate({
12+
this.debugName,
13+
});
14+
15+
/// The debug name used for the isolate spawned by this instance.
16+
final String? debugName;
17+
1118
final _receivePort = ReceivePort();
1219
late final SendPort _sendPort;
1320
final _createdIsolate = Completer<void>();
@@ -26,6 +33,7 @@ class YAJsonIsolate {
2633
_receivePort.sendPort,
2734
onExit: _receivePort.sendPort,
2835
onError: _receivePort.sendPort,
36+
debugName: debugName,
2937
);
3038
_sendPort = await _events.next;
3139
_createdIsolate.complete();

packages/yet_another_json_isolate/lib/src/_isolates_web.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import 'dart:convert';
22

33
class YAJsonIsolate {
4+
YAJsonIsolate({
5+
String? debugName,
6+
});
7+
48
Future<void> initialize() async {}
59

610
Future<void> dispose() async {}

0 commit comments

Comments
 (0)