diff options
| author | 2026-01-24 17:46:54 +0300 | |
|---|---|---|
| committer | 2026-01-24 17:46:54 +0300 | |
| commit | 95fc6de88975781abfe576977c960197a9743442 (patch) | |
| tree | 00ed76b0ff22f71af4b450c604f16ada72ed5241 /opts.go | |
| download | eventbus-1.0.0.tar.gz eventbus-1.0.0.tar.bz2 eventbus-1.0.0.tar.xz eventbus-1.0.0.zip | |
v1.0.0v1.0.0
Diffstat (limited to 'opts.go')
| -rw-r--r-- | opts.go | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -0,0 +1,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), + } +} |
