Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. emitter

emitter

NOASSERTIONGo

A channel-based pubsub package for Go with wildcard support, predicates, cancellation, and flexible event handling.

GitHubGitHub
532 stars37 forks0 contributors

What is emitter?

Emitter is a Go library that implements a channel-based publish-subscribe pattern for event-driven programming. It allows components to communicate asynchronously via events, supporting wildcard subscriptions, middleware predicates, and fine-grained control over event emission and cancellation. It solves the need for a simple, idiomatic pubsub solution in Go that leverages channels instead of callbacks.

Target Audience

Go developers building event-driven applications, microservices, or systems requiring decoupled communication between components. It's particularly useful for those who prefer channel-based concurrency over traditional callback patterns.

Value Proposition

Developers choose Emitter for its minimal API, seamless integration with Go's concurrency model, and features like wildcard support and middleware predicates. It offers more control and flexibility than basic callback systems while remaining lightweight and idiomatic.

Overview

Emits events in Go way, with wildcard, predicates, cancellation possibilities and many other good wins

Use Cases

Best For

  • Implementing decoupled communication between microservices in Go
  • Building event-driven architectures with wildcard subscription patterns
  • Adding middleware-based event interception and modification
  • Handling event cancellation and timeouts in concurrent applications
  • Merging events from multiple sources into a single channel
  • Using pubsub with type-safe argument casting and defaults

Not Ideal For

  • Projects requiring distributed event handling across multiple nodes or persistent storage
  • Teams that prefer traditional callback patterns and want to avoid Go channel complexity
  • Applications needing advanced type safety or schema validation for event payloads
  • Use cases where minimal overhead is critical and channel-based model adds unacceptable latency

Pros & Cons

Pros

Wildcard Subscription Support

Based on path.Match, allowing flexible event routing with patterns like '*', making it easy to subscribe to multiple events at once, as shown in the wildcard examples.

Middleware Predicates

Enables event interception, modification, and skipping via middlewares, providing fine-grained control over event flow, demonstrated in the middleware section with flag setting.

Cancellation Control

Leverages Go's channel semantics to discard events by closing channels, ideal for timeout-based workflows, as detailed in the cancellation example.

Sync/Async Modes

Allows per-listener or per-topic choice between synchronous and asynchronous emission using flags, optimizing for different concurrency needs without locking.

Type Casting Helpers

Provides shallow casting of event arguments to int, string, float64, or bool with optional defaults, simplifying argument handling without manual assertions.

Cons

Limited Error Handling

The wildcard feature uses path.Match but doesn't return parsing errors, which could lead to silent failures in topic matching, as mentioned in the README.

Channel Overhead

Relies on Go channels and goroutines, introducing potential overhead for simple use cases where traditional callbacks might be more efficient.

No Distributed Support

Lacks built-in features for cross-process or network event broadcasting, requiring additional layers for distributed systems, unlike dedicated message brokers.

Frequently Asked Questions

Quick Stats

Stars532
Forks37
Contributors0
Open Issues3
Last commit3 years ago
CreatedSince 2015

Tags

#event-driven#emitter#channels#wildcard#golang-library#golang#pubsub#concurrency#go#middleware#event-emitter

Built With

G
Go

Included in

Go169.1k
Auto-fetched 9 hours ago

Related Projects

AsynqAsynq

Simple, reliable, and efficient distributed task queue in Go

Stars13,683
Forks978
Last commit2 months ago
saramasarama

Sarama is a Go library for Apache Kafka.

Stars12,515
Forks1,864
Last commit22 hours ago
CentrifugoCentrifugo

Scalable real-time messaging server in a language-agnostic way. Self-hosted alternative to Pubnub, Pusher, Ably, socket.io, Phoenix.PubSub, SignalR. Set up once and forever.

Stars10,724
Forks730
Last commit1 day ago
WatermillWatermill

Building event-driven applications the easy way in Go.

Stars9,881
Forks505
Last commit13 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub