aboutsummaryrefslogtreecommitdiff
path: root/opts.go
diff options
context:
space:
mode:
author2026-01-24 17:56:58 +0300
committer2026-01-24 17:56:58 +0300
commit9fb220096a8a50bd89f0d7578d572629531f8141 (patch)
treed454c0efc1268cc0c15384d2a4585312562a1c0c /opts.go
parentv1.0.0 (diff)
downloadeventbus-9fb220096a8a50bd89f0d7578d572629531f8141.tar.gz
eventbus-9fb220096a8a50bd89f0d7578d572629531f8141.tar.bz2
eventbus-9fb220096a8a50bd89f0d7578d572629531f8141.tar.xz
eventbus-9fb220096a8a50bd89f0d7578d572629531f8141.zip
v1.0.1v1.0.1
Diffstat (limited to 'opts.go')
-rw-r--r--opts.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/opts.go b/opts.go
index 620e263..905c193 100644
--- a/opts.go
+++ b/opts.go
@@ -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),