eventd.go
func (b *Bus) Subscribe(h Handler) bool {
	b.mu.Lock()
	defer b.mu.Unlock()

	for _, v := range b.handlers {
		if v == h {
			return false
		}
	}

	b.handlers = append(b.handlers, h)
	return true
}
func (b *Bus) Subscribe(h Handler) bool {
	b.mu.Lock()
	defer b.mu.Unlock()

	for _, v := range b.handlers {
		if v == h {
			return false
		}
	}

	b.handlers = append(b.handlers, h)
	return true
}
func ( b * Bus ) Subscribe ( h Handler ) bool { b . mu . Lock ( ) defer b . mu . Unlock ( ) for _ , v := range b . handlers { if v == h { return false } } b . handlers = append ( b . handlers , h ) return true }
// Subscribe to events.
// It will return true if successfully subscribed, means the handler haven't subscribed before.
Subscribe to events . It will return true if successfully subscribed means the handler haven t subscribed before .