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) } }
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 }