``` Package Name Current Version Updated Version Update Reason flame 1.15.0 1.16.0 manual versioning flame_audio 2.1.8 2.10.0 manual versioning flame_bloc 1.10.10 1.11.0 manual versioning flame_fire_atlas 1.4.8 1.5.0 manual versioning flame_rive 1.9.11 1.10.0 manual versioning flame_riverpod 5.2.0 5.3.0 manual versioning flame_svg 1.9.0 1.10.0 manual versioning flame_test 1.15.4 1.16.0 manual versioning flame_texturepacker 3.0.0 3.1.0 manual versioning flame_tiled 1.18.4 1.19.0 manual versioning flame_forge2d 0.16.0+5 0.17.0 updated with major changes flame_isolate 0.5.1 0.6.0 updated with major changes flame_lottie 0.3.0+8 0.4.0 updated with major changes flame_markdown 0.1.1+8 0.2.0 updated with major changes flame_network_assets 0.2.0+13 0.3.0 updated with major changes flame_noise 0.2.0 0.3.0 updated with major changes flame_oxygen 0.1.9+8 0.2.0 updated with major changes flame_spine 0.1.1+10 0.2.0 updated with major changes flame_splash_screen 0.2.0 0.3.0 updated with major changes jenny 1.2.1 1.3.0 updated with minor changes ```
Adds support for integral_isolates to your Flame games.
flame_isolate
The power of integral_isolates in your Flame game.
Usage
Just add the mixin FlameIsolate to your component and start utilizing the power of an isolate as
simple as running the compute
function.
Example:
class MyGame extends FlameGame with FlameIsolate {
...
@override
void update(double dt) {
if (shouldRecalculate) {
isolate(recalculateWorld, worldData).then(updateWorld);
}
...
}
...
}
Performance note
Keep in mind that every component with FlameIsolate mixin that you create and add to your game
will create a new isolate. This means you will probably want to create a manager component to
manage a lot of "dumber" components. Think of it like ants, where the queen controls the worker
ants. If every individual worker ant got it's own isolate, it would be a total waste of power,
hence you would put it on the queen, which in turn tells all the worker ants what to do.
A simple example of this can be found in the example application for the FlameIsolate package.
Backpressure Strategies
Backpressure strategies is a way to cope with the job queue when job items are produced more rapidly
than the isolate can handle them. This presents the problem of what to do with such a growing
backlog of unhandled jobs. To mitigate this problem this library funnels all jobs through a job
queue handler. Also known as BackpressureStrategy.
The ones currently supported are:
NoBackPressureStrategythat basically does not handle back pressure. It uses a FIFO stack for storing a backlog of unhandled jobs. -ReplaceBackpressureStrategythat has a job queue with size one, and discards the queue upon adding a new job. -DiscardNewBackPressureStrategythat has a job queue with size one, and as long as the queue is populated a new job will not be added.
You can specify a backpressure strategy by overriding the backpressureStrategy field. This will
create the isolate with the specified strategy when component is mounted.
class MyGame extends FlameGame with FlameIsolate {
@override
BackpressureStrategy get backpressureStrategy => ReplaceBackpressureStrategy();
...
}
Additional information
You could expect this API to be mostly stable, but implementation of the underlying package (integral_isolates) is not fully finalized yet, and there is more features coming before both packages can count as stable.