diff options
| author | 2026-01-24 17:56:58 +0300 | |
|---|---|---|
| committer | 2026-01-24 17:56:58 +0300 | |
| commit | 9fb220096a8a50bd89f0d7578d572629531f8141 (patch) | |
| tree | d454c0efc1268cc0c15384d2a4585312562a1c0c /opts.go | |
| parent | v1.0.0 (diff) | |
| download | eventbus-1.0.1.tar.gz eventbus-1.0.1.tar.bz2 eventbus-1.0.1.tar.xz eventbus-1.0.1.zip | |
v1.0.1v1.0.1
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), |
