UsingStream<T, R> constructor

UsingStream<T, R>(
  1. FutureOr<R> resourceFactory(),
  2. Stream<T> streamFactory(
    1. R
    ),
  3. FutureOr<void> disposer(
    1. R
    )
)

Construct a UsingStream that creates a resource object from resourceFactory, and then creates a Stream from streamFactory and resource as argument. When the Stream terminates, call disposer on resource object.

Implementation

UsingStream(
  FutureOr<R> Function() resourceFactory,
  Stream<T> Function(R) streamFactory,
  FutureOr<void> Function(R) disposer,
) : super(_buildStream(resourceFactory, streamFactory, disposer));