vibe.d beta banner
get vibe.d
0.10.0

Asynchronous I/O that doesn’t get in your way, written in D

Function Channel.consumeAll

Attempts to consume all elements currently in the queue.

bool consumeAll (
  ref RingBuffer!(T,buffer_size) dst
);

bool consumeAll (
  ref RingBuffer!(T,buffer_size) dst
) shared;

bool consumeAll (
  ref FixedRingBuffer!(T,buffer_size) dst
);

bool consumeAll (
  ref FixedRingBuffer!(T,buffer_size) dst
) shared;

This function will block if no elements are available. Once at least one element is available, the contents of dst will be replaced with all available elements.

If the empty property is or becomes true before data becomes avaiable, dst will be left untouched and false is returned.

Authors

Sönke Ludwig

Copyright

© 2017-2019 Sönke Ludwig

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.