Closed Vafo closed 1 year ago
Events are:
Events differ by priority
General idea is that user plugs functions to these events (wiki), and once event takes place, it just invokes every associated function. However, the problem is if there is any function that goes into busy looping (e.g. in workshop5), how to make it leave once other event happens? How to stop them in general?
At first glance it seems to me that there should be 2 kinds of event handling: immediate and postponed. So maybe immediate would just "turn off" appropriate flag, upon which the busy loop depends?
Currently, I believe better solution would be to implement general message module, which would allow user to enqueue & dequeue custom events (enums), and maybe to execute something immediately on enqueue (flags that stop busy loops)
It is up to user of module to decide how to trigger the events (clicks & other interrupts)
Also a message should contain stack allocated type msg, with fields:
Busy loop goes through messages, that were generated externally