future_queue 1.0.0 copy "future_queue: ^1.0.0" to clipboard
future_queue: ^1.0.0 copied to clipboard

outdated

Dart package which provides sequential future execution with return values.

future_queue #

Dart package which provides sequential future execution with return values.

How it works #

Here is a code example which demonstrates how futures are queued:

final futureQueue = FutureQueue<int>();

final result1 = futureQueue.append(
  () => Future.delayed(Duration(seconds: 5), () => 1),
);
final result2 = futureQueue.append(
  () => Future.delayed(Duration(seconds: 1), () => 2),
);

print('result1: ${await result1}');
print('result2: ${await result2}');

Will print:

1
2

Even though the first future takes 4 seconds longer than the second future.

Error handling #

If the future throws an exception it can be caught, as usual, by chaining a catchError on the Future returned by FutureBuilder's append.

1
likes
0
pub points
36%
popularity

Publisher

verified publisherbalanci.ng

Dart package which provides sequential future execution with return values.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

More

Packages that depend on future_queue