A channel-based pubsub package for Go with wildcard support, predicates, cancellation, and flexible event handling.
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.
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.
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.
Emits events in Go way, with wildcard, predicates, cancellation possibilities and many other good wins
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
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.
Enables event interception, modification, and skipping via middlewares, providing fine-grained control over event flow, demonstrated in the middleware section with flag setting.
Leverages Go's channel semantics to discard events by closing channels, ideal for timeout-based workflows, as detailed in the cancellation example.
Allows per-listener or per-topic choice between synchronous and asynchronous emission using flags, optimizing for different concurrency needs without locking.
Provides shallow casting of event arguments to int, string, float64, or bool with optional defaults, simplifying argument handling without manual assertions.
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.
Relies on Go channels and goroutines, introducing potential overhead for simple use cases where traditional callbacks might be more efficient.
Lacks built-in features for cross-process or network event broadcasting, requiring additional layers for distributed systems, unlike dedicated message brokers.