Fetching latest headlinesโ€ฆ
A minimal, in-process event bus for Go
NORTH AMERICA
๐Ÿ‡บ๐Ÿ‡ธ United Statesโ€ขJune 28, 2026

A minimal, in-process event bus for Go

1 views0 likes0 comments
Originally published byDev.to

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.

Comments (0)

Sign in to join the discussion

Be the first to comment!