diff --git a/Dispatcher.st b/Dispatcher.st index 4015378..4ddcaec 100644 --- a/Dispatcher.st +++ b/Dispatcher.st @@ -52,12 +52,19 @@ Object subclass: Dispatcher [ ] dispatch [ - | block | + | block sem | block := queue next. + sem := Semaphore new. + "Run the code in a new process as the debugger might terminate this + and then the dispatcher would not dispatch anymore. Use a Semaphore + to make sure we keep on processing items in order." + [[ block on: Error do: [:error | error logException: 'dispatch failed on "%1".' % {block} area: #core. - ] + ]] ensure: [sem signal]] fork. + + sem wait. ] ]