A minimal, in-process event bus for Go

작성자

카테고리:

← 피드로
DEV Community · F2077 · 2026-06-28 개발(SW)

F2077

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 arbitrary any 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.

원문에서 계속 ↗

코멘트

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다