I've got some pretty simple code that looks something like:

if (!exhange.isDispatched()) {
    exchange.dispatch(() -> {
        assert exchange.isDispatched();
         // more stuff....

but the assert fails. That is, when dispatch calls my runnable isDispatched is not true.

I believe I have a bug somewhere with how/when dispatches are happening so I've littered my code with such asserts and they fail reliably even when I'm quite sure the exchange has been dispatched (e.g. when it is literally the first call in a Runnable passed to to the dispatch() method).

What am I doing wrong?
CTO, Analytic Spot
44 West Broadway #222
Eugene, OR 97401
analyticspot.com • 425-296-6556