next up previous contents
Next: Simple Clicks Up: A Short Introduction to Previous: The Grid Packer

Events

 

In general, events are an abstract datatype for communication and synchronisation, much in the spirit of process algebras such as CCS [2], CSP [5] or the calculus [3]. Here, an Events.htmlEvent is an abstract datatype with operations such as sync, +> and >>>=, which additionally form a monad; we refer to [6] for more information.

In HTK, basic events arise from user interactions by means of the bind commands. By binding a user interaction (such as clicking a button), we set it up to produce an event, on which we can synchronise and thus produce a reaction to the user's action. We can then use the event operators to build more complex events with these basic events.

One important caveat here is that once you set up a binding, you must eventually synchronise on the resulting events, since otherwise the unused events will pile up and result in a memory leak.

Bindings are generated by calling one of clicked, bindSimple and bind, where bind is most flexible, as can be seen by its complex type.





Christoph Lueth
Wed May 29 13:20:38 MEST 2002