From b12adc353f5fc3d82e4e0b602fea42013f71b893 Mon Sep 17 00:00:00 2001 From: Misha Soliterman Date: Fri, 14 Feb 2025 12:20:13 +0900 Subject: [PATCH 1/2] feat: Add debugName parameter to YAJsonIsolate. --- .../yet_another_json_isolate/lib/src/_isolates_io.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/yet_another_json_isolate/lib/src/_isolates_io.dart b/packages/yet_another_json_isolate/lib/src/_isolates_io.dart index 07913afe4..54d74ba10 100644 --- a/packages/yet_another_json_isolate/lib/src/_isolates_io.dart +++ b/packages/yet_another_json_isolate/lib/src/_isolates_io.dart @@ -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(); @@ -26,6 +33,7 @@ class YAJsonIsolate { _receivePort.sendPort, onExit: _receivePort.sendPort, onError: _receivePort.sendPort, + debugName: debugName, ); _sendPort = await _events.next; _createdIsolate.complete(); From 30c549d08510f1ac2f146373c5fd7d430e7695bd Mon Sep 17 00:00:00 2001 From: Misha Soliterman Date: Sat, 15 Feb 2025 09:35:06 +0900 Subject: [PATCH 2/2] fix: Make the web isolate have the same constructor signature as the io isolate. --- packages/yet_another_json_isolate/lib/src/_isolates_web.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/yet_another_json_isolate/lib/src/_isolates_web.dart b/packages/yet_another_json_isolate/lib/src/_isolates_web.dart index c88ad6c70..457909658 100644 --- a/packages/yet_another_json_isolate/lib/src/_isolates_web.dart +++ b/packages/yet_another_json_isolate/lib/src/_isolates_web.dart @@ -1,6 +1,10 @@ import 'dart:convert'; class YAJsonIsolate { + YAJsonIsolate({ + String? debugName, + }); + Future initialize() async {} Future dispose() async {}