func (d *Dispatcher) Unregister(id uint64) bool {
	d.trieMut.Lock()
	did := d.trie.unregister(id)
	d.trieMut.Unlock()
	return did
}
Unregister uses the identifier returned by Register to unregister a
callback from the Dispatcher. If the callback was removed it returns
true, false if it could not be found.
package dispatch
import (
	"sync"
	"github.com/aarondl/ultimateq/data"
	"github.com/aarondl/ultimateq/dispatch/cmd"
	"github.com/aarondl/ultimateq/irc"
)
type Handler interface {
	Handle(w irc.Writer, ev *irc.Event)
}
type HandlerFunc func(w irc.Writer, ev *irc.Event)
func (h HandlerFunc) Handle(w irc.Writer, ev *irc.Event) {
	h(w, ev)
}
type EventDispatcher interface {
	Register(network, channel, event string, handler Handler) uint64
	Unregister(id uint64) bool
	Dispatch(w irc.Writer, ev *irc.Event)
}
type CmdDispatcher interface {
	Register(network, channel string, command *cmd.Command) (uint64, error)
	Unregister(id uint64) bool
	Dispatch(irc.Writer, *irc.Event, data.Provider) (bool, error)
}
type Dispatcher struct {
	*Core
	trieMut sync.RWMutex
	trie    *trie
}
func NewDispatcher(core *Core) *Dispatcher {
	return &Dispatcher{
		Core: core,
		trie: newTrie(false),
	}
}
func (d *Dispatcher) Register(network, channel, event string, handler Handler) uint64 {
	if event == irc.RAW {
		event = ""
	}
	d.trieMut.Lock()
	id := d.trie.register(network, channel, event, handler)
	d.trieMut.Unlock()
	return id
}