Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 2.1% on proxy.golang.org
Top 0.8% dependent packages on proxy.golang.org
Top 0.5% dependent repos on proxy.golang.org
Top 5.2% forks on proxy.golang.org
Top 0.6% docker downloads on proxy.golang.org

proxy.golang.org : github.com/mustafaturan/bus

Package bus is a minimalist event/message bus implementation for internal communication The package requires a unique id generator to assign ids to events. You can write your own function to generate unique ids or use a package that provides unique id generation functionality. The `bus` package respect to software design choice of the packages/projects. It supports both singleton and dependency injection to init a `bus` instance. Here is a sample initilization using `monoton` id generator: Example code for configuration: To emit events to the topics, topic names should be registered first: Example code: To receive topic events you need to register handlers; A handler basically requires two vals which are a `Handle` function and topic `Matcher` regex pattern. Example code: Example code: When an event is emitted, the topic handlers receive the event synchronously. It is highly recommended to process events asynchronous. Package leave the decision to the packages/projects to use concurrency abstractions depending on use-cases. Each handlers receive the same event as ref of `bus.Event` struct.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/mustafaturan/bus
Keywords: eventbus, go, go-library, go-package, message-broker, message-bus, pubsub, zero-alloc, zero-allocation
License: Apache-2.0
Latest release: over 4 years ago
First release: about 5 years ago
Namespace: github.com/mustafaturan
Dependent packages: 34
Dependent repositories: 194
Stars: 289 on GitHub
Forks: 18 on GitHub
Docker dependents: 72
Docker downloads: 478,340
See more repository details: repos.ecosyste.ms
Funding links: https://github.com/sponsors/mustafaturan
Last synced: about 21 hours ago

    Loading...
    Readme
    Loading...