need help with vibe.d receive()

crimaniak crimaniak at gmail.com
Wed Jan 10 14:39:04 UTC 2018


Hi!

I make multi-task event bus, but there is a problem with the task 
stops.
Please see end of file
https://github.com/crimaniak/d-vision/blob/master/src/vision/eventbus.d

Expected behavior: After sending the StopEvent message in line 
244 it is must be detected in listeners (line 147), so all 
listeners must set exit flag to 'true' and quit immediately.
De-facto behavior: StopEvent() message is not detected by the 
first delegate in line 147 (logger task logs this message by the 
handler in line 185), so subscribed tasks never exit and test 
stops on line 248.

I tried to play with yield() and sleep(), with 'shared' 
attributes and so on, but without result. Can you say please what 
I am doing wrong here?

'dub test' can be used to play with tests.


More information about the Digitalmars-d-learn mailing list