feat: Add debugName parameter to YAJsonIsolate. #1118
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
This is a new feature for
YAJsonIsolate
.In testing environments, it's easy to have multiple clients open. Specifically, I usually have an admin client and a client for the current user, but I can't tell which is which because all isolates have the same name. When an error occurs in the isolate, it takes a lot of effort to figure out which client produced it.
I would like to be able to rename isolates, specifically for use in debugging.
What is the current behavior?
Currently, all isolates spawned have the name
_compute
.Here's a screenshot of what it looks like in VSCode.
What is the new behavior?
There's now a
debugName
constructor parameter onYAJsonIsolate
. The user can add the library to their package and instantiate an instance with their desireddebugName
if they want to access it.Here's a screenshot of what it looks like in VSCode, after setting the name to
my_isolate
.Additional context
Two questions:
_isolates_web.dart
. Does this now need the same (albeit unused) constructor parameter?Isolate
instance to verify it gets created with the specifieddebugName
, but then I have to remember to unassign it so I'd rather just not store it. If a test is required, let me know what it should do.