Esempio n. 1
0
func (self *EventBus) RemoveListener(name string, m *machine.Machine) {
	key := fmt.Sprintf("%s-%s", name, m.String())
	if _, ok := self.listeners[key]; ok {
		delete(self.listeners, key)
	}
}
Esempio n. 2
0
func (self *EventBus) AddListener(name string, m *machine.Machine, l interface{}) {
	listener := EventListener{m, l}
	key := fmt.Sprintf("%s-%s", name, m.String())
	self.listeners[key] = listener
}