Commit Graph

11 Commits

Author SHA1 Message Date
Alex Bramley 0dc19703ab gofix weekly fixes for event. 2011-11-13 13:32:10 +00:00
Alex Bramley 177149fd3c Remove lists when empty after deleting elements. 2011-11-09 21:38:47 +00:00
Alex Bramley bdb5c9b1a0 Squash a couple of bugs found by the unit tests. 2011-11-09 21:14:24 +00:00
Alex Bramley cdd08b2de8 Remove extraneous use of append in serialDispatch. 2011-11-09 20:30:37 +00:00
Alex Bramley 6e87169e2c Make API for adding/deleting handlers more coherent.
Previously, it was possible to add the same handler (as returned by NewHandler)
to multiple different event lists, but DelHandler only removed a handler from
*all* event lists it was present in. This may not be wanted behaviour, and
reduces control over the event lists.

Instead, allow both Add and DelHandler to take a variadic list of events to
add or delete handlers from.
2011-11-07 13:13:46 +00:00
Alex Bramley c400a2141a Run gofmt over code, it's been a while. 2011-09-12 23:25:09 +01:00
Alex Bramley 8e6de2f3c7 Add an overridable Dispatcher to Conn, and use that to dispatch events. 2011-07-27 21:40:56 +01:00
Alex Bramley a2b53e6fc3 Rename registry -> event for gb purposes. 2011-07-27 21:00:23 +01:00
Alex Bramley 5843974562 Make struct registry conform to EventRegistry. 2011-07-27 20:59:58 +01:00
Alex Bramley cce112465f Make Handler an interface type; make dispatcher private; correctly unbox ev. 2011-07-27 17:49:34 +01:00
Alex Bramley 2c10e19f58 More abstracted event registry. 2011-07-27 16:54:49 +01:00