dyno 0.0.1 dyno: ^0.0.1 copied to clipboard
An isolation pool with load balancer for Flutter. Creates and kills isolates as needed.
Dyno #
Creates an isolation pool and manages it dynamically to run a closure isolated.
Tip: running heavy computations isolated prevents lags in application. An isolate has it's own memory and event loop.
Features #
➡️ It doesn't create isolates for every process, communicates bidirectionally with isolations.
➡️ Has a load balancer, creates and kills isolates automatically according to load.
➡️ Lightweight, only 182 lines.
Getting started #
Add dependency to pubspec.yaml
:
dyno: ^0.0.1
Usage #
- Import
dyno
,
import 'package:dyno/dyno.dart' as dyno;
- prepare isolates before use. (This an optional step)
Dyno creates isolates as needed, but preparing speeds up first run. You can prepare dyno on the splash screen or any other desired place.
dyno.prepare(single: false);
prepare
creates two isolate by default, but creates one isolate whensingle
parameter is set to true.
- Run a closure isolated,
final result = await dyno.run<String>(() {
// Some complex process.
return 'result of process';
});
Maintainer #
Hey, I'm Ertuğrul, please feel free to ask any questions about this tool. If you find Dyno
useful, you can hit the like button and give a star to project on Github to motivate me or treat me with coffee.