Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add debugName parameter to YAJsonIsolate. #1118

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/yet_another_json_isolate/lib/src/_isolates_io.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ import 'package:async/async.dart';

// One instance manages one isolate
class YAJsonIsolate {
YAJsonIsolate({
this.debugName,
});

/// The debug name used for the isolate spawned by this instance.
final String? debugName;

final _receivePort = ReceivePort();
late final SendPort _sendPort;
final _createdIsolate = Completer<void>();
Expand All @@ -26,6 +33,7 @@ class YAJsonIsolate {
_receivePort.sendPort,
onExit: _receivePort.sendPort,
onError: _receivePort.sendPort,
debugName: debugName,
);
_sendPort = await _events.next;
_createdIsolate.complete();
Expand Down
4 changes: 4 additions & 0 deletions packages/yet_another_json_isolate/lib/src/_isolates_web.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import 'dart:convert';

class YAJsonIsolate {
YAJsonIsolate({
String? debugName,
});

Future<void> initialize() async {}

Future<void> dispose() async {}
Expand Down