aboutsummaryrefslogtreecommitdiff
path: root/opts.go
diff options
context:
space:
mode:
Diffstat (limited to 'opts.go')
-rw-r--r--opts.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/opts.go b/opts.go
new file mode 100644
index 0000000..620e263
--- /dev/null
+++ b/opts.go
@@ -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),
+ }
+}