My understanding of events is much more basic than the others discussing this issue, but I have a naive question.
Why are low level OS events like mouse clicks and keyboard strokes treated differently from a general events mechanism? By this I mean a mechanism for passing messages to 'subscribers' whenever an object emits an event (publish-subscribe)? It seems to me that any event still has an Object from which it originates, and one or more objects that will be told the event has occurred. Why can't low and high level events share the same abstractions, and even be placed on the same event queue? I also think exception-handling has much in common with event handling (on: exception do: aBlock). The exception looks to me very much like an 'event' that the block is told about. Is it possible to fuse these three mechanisms into a common abstraction and reuse a lot of the code, or is this just wishful thinking on my part?
Peter
From: Reinier van Loon R.L.J.M.W.van.Loon@inter.nl.net To: squeak@cs.uiuc.edu squeak@cs.uiuc.edu Date: Thursday, July 01, 1999 6:06 AM Subject: Re: [ENH] OS-level events
I keep getting the impression that the event systems designed so far are only concerned with keyboard or mouse events. These events are then put in an event queue with some information regarding the event.
Why not define an event as <time, object> and event queue as a collection sorted by time? The global event (interrupt) handler detects an event on the queue (tim's work) and gets the rest of the event of the object mentioned in the event.
In this way, each object (keyboard, mouse, network, etc.) can have it's own buffer. And composite events are detected easily by comparing the time stamps.
You could even start new processes to deal with events or have different event handlers wait on the queues of the objects. No 'centralized' event queue anymore.
Just an idea.
Reinier.