backyard 1.0.0 copy "backyard: ^1.0.0" to clipboard
backyard: ^1.0.0 copied to clipboard

long-lived isolate with generic way of execution functions

Backyard #

Spawn an abstraction of a permanent isolate called Backyard on which you can execute arbitrary functions - and they are running on a separate thread. This is useful since spawning an isolate still takes 15+ ms and the average latency of passing a function back and forth through Backyard is around 1ms.

    final backyard = Backyard();

    // initialise backyard (takes around 15ms)
    await backyard.init();

    // executes an arbitrary function (takes 1ms)
    final result = await backyard.execute<int>(() => 1 + 2); // returns 3
14
likes
120
points
26
downloads

Publisher

verified publisherquantumgray.tech

Weekly Downloads

long-lived isolate with generic way of execution functions

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

logger

More

Packages that depend on backyard