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

Simple helper to run stream transformation through newly spawned isolate.

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
40
pub points
0%
popularity

Publisher

unverified uploader

Simple helper to run stream transformation through newly spawned isolate.

Repository (GitHub)
View/report issues

License

BSD-2-Clause (LICENSE)

More

Packages that depend on transform_in_isolate