← 피드로
A minimal, in-process event bus for Go — typed events, cancelable listeners,
and one-shot handlers, built on top of the zero-allocation
go-pubsub engine.
🔔 go-bus is in-process and fire-and-forget. It is the right tool for
decoupling components inside a single Go binary. If you need to cross a
process or network boundary, reach for NATS, Kafka, or RabbitMQ instead.
Why go-bus?
🎯 Typed events Dispatch arbitraryany payloads keyed by a typed Event.
⚡ Zero-alloc emits
The publish hot path allocates nothing for a known event — see Performance.
🔄 One-shot handlers
Listeners can auto-remove after their first trigger.
🎛️ Context-based cancel
Every listener owns a context.Context; cancel stops it cleanly.
🛡️ Panic-safe
A panicking listener is recovered and logged; it keeps running on later messages.
🔌 Thin layer
A focused wrapper over go-pubsub — no hidden runtime, no goroutine zoo to manage.
추출 본문 · 출처: dev.to · https://dev.to/f2077/a-minimal-in-process-event-bus-for-go-2hh3
답글 남기기