UsingStream<T, R> constructor
UsingStream<T, 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({
required FutureOr<R> Function() resourceFactory,
required Stream<T> Function(R) streamFactory,
required FutureOr<void> Function(R) disposer,
}) : super(_buildStream(resourceFactory, streamFactory, disposer));