transform_in_isolate 0.1.1 copy "transform_in_isolate: ^0.1.1" to clipboard
transform_in_isolate: ^0.1.1 copied to clipboard

outdated

Run stream transfor in isolate. Spawns new isolate when bind() method is called on isolate. Instance of transformer is then sent to isolate. Initial state within transformer as well as stream messages [...]

transform_in_isolate #

Run stream transformer in isolate.

New isolate is spawned when stream.transform() is called, and closes when either input stream completes or output subscription is cancelled.

API:

TransformInIsolate(StreamTransformer<S, T>) -> StreamTransformer<S, T>

Example:

Stream.fromIterable([1, 2, 3])
      .transform(TransformInIsolate(MyTransform()))
      .listen(print);

class MyTransform extends StreamTransformerBase {
    bind(s) => s.map((val) => val * 2)  // this code will run in isolate
}
1
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Run stream transfor in isolate. Spawns new isolate when bind() method is called on isolate. Instance of transformer is then sent to isolate. Initial state within transformer as well as stream messages must be isolate-transferable.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

More

Packages that depend on transform_in_isolate