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

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Aug 27 06:28:23 PDT 2015


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

Dmitry Olshansky <dmitry.olsh at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dmitry.olsh at gmail.com

--- Comment #5 from Dmitry Olshansky <dmitry.olsh at gmail.com> ---
> Related to this is the possibility to get the size of the message box, e.g. you would only want to flush a message box, if its size is > 0. I haven't found a way to get the size of the message box, unless something has escaped me.

In an async world with fire and forget message passing all of the above is
marred with race conditions. You might check that size == 0 the next instant
the message comes in. 

I think the only legitimate use case would be dropUntil!(SomeMessageTypesHere)
as it at least has a point of serialization - marker message in a stream of
messages.

--


More information about the Digitalmars-d-bugs mailing list