Commit Graph

7 Commits

Author SHA1 Message Date
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