append method

Future<T> append(
  1. Future<T> future(
    1. T? previous
    ), {
  2. Duration? timeLimit,
})

Adds the given future to queue. Note that the previous value will be null if the last operation caused an exception.

Implementation

Future<T> append(Future<T> Function(T? previous) future,
    {Duration? timeLimit}) {
  return _future = _future.then(
    (previous) => _nextValue(future, previous, timeLimit: timeLimit),
    onError: (_) => _nextValue(future, null, timeLimit: timeLimit),
  );
}