NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #1658 most downloaded on pub.dev
An easy way to create a new Isolate, keep it active and communicate with it (supports `Worker` and `WASM` on the Web platform).
Last release 2 years ago
no release in 18 months
Release timing varies
gaps range from 8 days to 9 months
Nearly every release is documented
notes for 27 of 30 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
37 releases · first in 2021
Migrate to package:web from dart:html to support wasm.
package:web from dart:html to support wasm.initialized signal from the Isolate to the main app. The migration steps:
Step 1:
Advanced method:
final channel = IsolateContactorController<double, List<double>>(params);
channel.onIsolateMessage.listen((message) {
channel.sendResult(add(message));
});
final channel = IsolateContactorController<double, List<double>>(params);
channel.onIsolateMessage.listen((message) {
channel.sendResult(add(message));
});
channel.initialized(); // <--
Worker on the Web:
main() {
callbackToStream('onmessage', (html.MessageEvent e) {
return js_util.getProperty(e, 'data');
}).listen((message) async {
jsSendMessage(add(message));
});
}
main() async {
// Do something sync or async here
callbackToStream('onmessage', (html.MessageEvent e) {
return js_util.getProperty(e, 'data');
}).listen((message) async {
jsSendMessage(add(message));
});
jsSendMessage(IsolateState.initialized.toJson()); // <--
}
Step 2: Update the create and createOwnIsolate method:
final isolate = await IsolateContactor.create(
function,
workerName: 'function',
);
final isolate = await IsolateContactor.create(
function,
workerName: 'function',
autoMarkAsInitialized: false, // <--
);
One column per quarter.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Deprecate the createOwnIsolate in favor of the createCustom.
if (dart.library.io) instead of if (dart.library.html) for more compatible.createOwnIsolate in favor of the createCustom.IsolateFunction, CustomIsolateFunction, IsolateConverter.worker folder.README is cleared and isn't maintained anymore. Read in the isolate_manager instead.Better way to check valid IsolateException.
Add sendResultError to IsolateContactorController to make it easier to send the Exception from the Isolate to main app.
sendResultError to IsolateContactorController to make it easier to send the Exception from the Isolate to main app.IsolateException parameters are now Object and StackTrace.P and change return type to R.void to onDispose method.isolateParams from dynamic to Object?.Nothing published for this version
Nothing published for this version
Bumped Dart sdk to >=2.18.0 <4.0.0.
>=2.18.0 <4.0.0.error_function.js name in test.Support try-catch block for all platforms including Worker on Web.
try-catch block for all platforms including Worker on Web.worker.dart to support try-catch block.Nothing published for this version
* Improve pub scores.
On Flutter >3.3.0 - @pragma('vm:entry-point') anotation must be added to all methods that you want to use for isolation. Read README for more informat
@pragma('vm:entry-point') anotation must be added to all methods that you want to use for isolation. Read README for more information.@pragma('vm:entry-point') to internal method.stream_channel: ^2.1.0 to avoid conflicts with flutter_test.Update worker.dart script for the Worker.
worker.dart script for the Worker.Improve function & parameter headers
Add Worker for Web platform (real Isolate on Web). Read README for more details.
Worker for Web platform (real Isolate on Web). Read README for more details.BREAKING CHANGE: Change parameter name from isolateParams to initialParams for createOwnIsolate.
isolateParams to initialParams for createOwnIsolate.initialParams when creating an own isolate:void isolateFunction(dynamic params) {
var controller = IsolateContactorController(params, onDispose: () {});
var initialParams = controller.initialParams;
controller.onIsolateMessage.listen((message) {
// Do your stuff here
});
}
Added IsolateContactorException, throw it when error occurs on sendMessage method.
IsolateContactorException, throw it when error occurs on sendMessage method.Future for dispose method.Now you can await for the result when using isolateContactor.sendMessage.
await for the result when using isolateContactor.sendMessage.Improved README for allowed return type version, Improved Test and Example.
Nothing published for this version
Now you can add return type for the stream listener. Example:
// `fibonacci` have `int` return type
IsolateContactor<int> isolateContactor = await IsolateContactor.create(fibonacci);
// `intEvent` will be `int` type
isolateContactorFuture.onMessage.listen((intEvent) {
// intEvent
});
// `fibonacci` have `int` return type
int fibonacci(dynamic n) {
if (n <= 2) return 1;
int n1 = 0, n2 = 1, n3 = 1;
for (int i = 2; i <= n; i++) {
n3 = n1 + n2;
n1 = n2;
n2 = n3;
}
return n3.round();
}
onDispose parameter to IsolateContactorController, this parameter allows you to add your own dispose method inside isolateFunction for .createOwnIsolate.Nothing published for this version
Fixed issue in internalIsolateFunction makes this function run twice.
internalIsolateFunction makes this function run twice.* Updated dependencies. * Improved function headers.
* Update dependencies * Update homepage * Cleanup
* Update README
* Update homepage
Fixed issue with the restart method.
restart method.pause and resume methods.debugMode in the create() and createOwnIsolate() methods was refactored to named optional parameters.Remove flutter dependencies to support dart native
Nothing published for this version
Support web platform with limited features. The package use Future to provide the same features to Isolate but it doesn't have pause, resume, restart
Future to provide the same features to Isolate but it doesn't have pause, resume, restart methods. I'll try to bring the same action with Isolate as much as possible.Future when creating build-in method. More information please read Readme.Create your own isolate:
Before:
void isolateFunction(List<dynamic> params) {
final channel = IsolateChannel.connectSend(params.last);
channel.stream.listen((rawMessage) {
final message = IsolateContactor.getMessage(rawMessage);
if (message != null) {
// Do more stuff here
// Send the result to your [onMessage] stream
channel.sendResult(add(message[0], message[1]));
}
}
Now:
void isolateFunction(dynamic params) {
final channel = IsolateContactorController(params);
channel.onIsolateMessage.listen((message) {
// Do more stuff here
// Send the result to your [onMessage] stream
channel.sendResult(add(message[0], message[1]));
});
}
* Update description
* Update flutter version
* Initial release
Your coding agent can read these notes before it upgrades. Set up the MCP server →