[Issue 14953] std.concurrency: Add function to flush message box

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Aug 26 02:12:35 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14953

--- Comment #3 from Chris <wendlec at tcd.ie> ---
I understand your concerns regarding data flow. However, it's up to the user
(programmer) to determine whether or not the pending messages are relevant.

A use case: a text-to-speech synthesizer that has several sentences in the
queue (e.g. reading out a document's content sentence by sentence or spelling
out a word letter by letter). When the user presses a button to cancel the
speech, the remaining items in the queue that haven't been spoken yet should be
flushed immediately, which is the desired behavior, else the user would have
pressed "pause".

I'm sure there are other use cases.

If the API is flexible enough to offer a mechanism for both an immediate and a
selective (filtered) flush, as you suggested, I think we're on the safe side.
We should definitely have a method with a filter too.

--


More information about the Digitalmars-d-bugs mailing list