Peeking concurrency messages

Francesco Mecca me at francescomecca.eu
Sun Jun 23 13:59:38 UTC 2019


On Sunday, 23 June 2019 at 09:33:27 UTC, Anonymouse wrote:
> Concurrency messages are sent via std.concurrency's send and 
> receive functions. Receiving a message consumes it, in the 
> sense that receiving again will catch the next message. The 
> only way of telling whether there is one waiting is to consume 
> the first and commit to handling it. In other words, there is 
> currently no way of checking whether the message box is empty; 
> all the (thread ID Tid) member variables via which you could 
> tell are private to the std.concurrency module.
>
> [...]

Can you explain your use case? Maybe there is an elegant solution 
without resorting to check if the mailbox is full.

Otherwise you could try a PR


More information about the Digitalmars-d mailing list