IsolateStream<T> constructor

IsolateStream<T>(
  1. IsolateStreamGenerator generator
)

Initialize a new stream with the given generator. A new isolate is created using Isolate.spawn, and the generator is sent to that isolate over a SendPort. The generator must therefore obey the restrictions described for sending an object instance in the dart VM described in SendPort.send. The generator must be a subclass of IsolateStreamGenerator

The generator sends objects of type T to our stream by calling appropriate inherited methods of IsolateStreamGenerator. A flow control protocol is established to throttle the generator, so that the buffer between the two isolates doesn't grow without bound.

Implementation

IsolateStream(IsolateStreamGenerator generator)
    : this._fromSession(_ConsumerSession(generator));