diff options
Diffstat (limited to 'opts.go')
| -rw-r--r-- | opts.go | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -1,24 +1,27 @@ package eventbus type Opt interface { - Apply(b *bus) + Apply(b *Bus) } +// NameSeparator sets the event name separator (default "."). type NameSeparator string -func (n NameSeparator) Apply(b *bus) { +func (n NameSeparator) Apply(b *Bus) { b.nameSeparator = string(n) } +// Wildcard sets the wildcard character for subscriptions (default "*"). type Wildcard string -func (w Wildcard) Apply(b *bus) { +func (w Wildcard) Apply(b *Bus) { b.wildcard = string(w) } +// Capacity sets the initial capacity for listeners trie (default 32). type Capacity int -func (c Capacity) Apply(b *bus) { +func (c Capacity) Apply(b *Bus) { b.listeners = node[Listener]{ children: make(map[string]*node[Listener], c), values: make([]Listener, 0, c), |
