The GUI event loop and vibe.d
Every modern graphical user interface is event-based. The typical events are keystrokes, mouse moves, and requests to repaint a part of the screen. A common requirement is that you have to react quickly to the event. If you fail to do so, then your user interface seems to be frozen. Most of the time, it is recommended that you move long-running computations to a separate thread. While this sounds like a good idea, there are some pitfalls. Some systems allow only the thread running the event loop to draw on the screen. In this case, you have to synchronize with the event thread, which can get complicated very fast.
Now, recall the fiber-based pseudo-blocking programming model from vibe.d, described in the previous chapter. An event queue is used to handle notifications that stem from asynchronous I/O. The processing is done in a fiber, which should quickly invoke the event loop again. As both concepts are so similar, the obvious idea is to combine both.
Depending...