I hope this isn't so general a question as to be thought a "discussion." I'm writing a simulation of an old (ca. 1960) computer, and I'm thinking about how to queue events from the GUI to the CPU "model." The GUI consists of momentary-on buttons (pushbuttons and typewriter keys) and toggle switches. Of course, I don't want either the GUI or the CPU thread to block.
As I think about the various sorts of events, I realize that (a) some should not be replicated in the queue, (b) some should be "expedited" -- i.e., sent to the head of the queue, and (c) some should simply be ignored under certain conditions.
Then I realized that I'm probably trying to re-solve an old problem. Undoubtedly others have encountered similar requirements when trying to design a GUI-to-model event queue. So I wondered - has some brilliant person abstracted the requirements of any GUI-to-model event-passing system, perhaps anticipating some functionality I haven't even thought of yet?
I'm coding in Java, but I would be implementing the queue, and the queuing, myself - and furthermore, I doubt there's anything Java-specific to this problem.