Skip to main content

blocking_queue 0.1.0 copy "blocking_queue: ^0.1.0" to clipboard
blocking_queue: ^0.1.0 copied to clipboard

Dart queues that wait for items, with either FIFO buffering or a buffer that keeps only the latest item.

example/blocking_queue_example.dart

import 'package:blocking_queue/blocking_queue.dart';

Future<void> main() async {
  final updates = SingleCapacityBlockingQueue<String>();

  final first = updates.dequeue();
  updates.enqueue('Starting');
  print(await first); // Starting

  updates.enqueue('Refreshing');
  updates.enqueue('Ready');
  print(await updates.dequeue()); // Ready

  updates.dispose();
}
0
likes
160
points
--
downloads

Documentation

API reference

Publisher

unverified uploader

Dart queues that wait for items, with either FIFO buffering or a buffer that keeps only the latest item.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

More

Packages that depend on blocking_queue