vibe.d beta banner
get vibe.d
0.10.1

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

Function Channel.empty

Determines whether there is more data to read in a single-reader scenario.

bool empty() @property;

bool empty() shared @property;

This property is empty iff no more elements are in the internal buffer and close() has been called. Once the channel is empty, subsequent calls to consumeOne or consumeAll will throw an exception.

Note that relying on the return value to determine whether another element can be read is only safe in a single-reader scenario. It is generally recommended to use tryConsumeOne instead.

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.