blob: 620e26360828bfbb577ace556b7f5496acf570d0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
package eventbus
type Opt interface {
Apply(b *bus)
}
type NameSeparator string
func (n NameSeparator) Apply(b *bus) {
b.nameSeparator = string(n)
}
type Wildcard string
func (w Wildcard) Apply(b *bus) {
b.wildcard = string(w)
}
type Capacity int
func (c Capacity) Apply(b *bus) {
b.listeners = node[Listener]{
children: make(map[string]*node[Listener], c),
values: make([]Listener, 0, c),
}
}
|