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

Top 5.1% on proxy.golang.org
Top 4.2% dependent packages on proxy.golang.org
Top 1.5% dependent repos on proxy.golang.org
Top 6.8% forks on proxy.golang.org

proxy.golang.org : github.com/juju/pubsub

Package pubsub provides publish and subscribe functionality within a single process. A message as far as a hub is concerned is defined by a topic, and a data blob. All subscribers that match the published topic are notified, and have their callback function called with both the topic and the data blob. All subscribers get their own goroutine. This way slow consumers do not slow down the act of publishing, and slow consumers do not inferfere with other consumers. Subscribers are guaranteed to get the messages that match their topic matcher in the order that the messages were published to the hub. This package defines two types of hubs. * Simple hubs * Structured hubs Simple hubs just pass the datablob to the subscribers untouched. Structuctured hubs will serialize the datablob into a `map[string]interface{}` using the marshaller that was defined to create it. The subscription handler functions for structured hubs allow the handlers to define a structure for the datablob to be marshalled into. Hander functions for a structured hub can get all the published data available by defining a callback with the signature: Or alternatively, define a struct type, and use that type as the second argument. The structured hub will try to serialize the published information into the struct specified. If there is an error marshalling, that error is passed to the callback as the error parameter.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/juju/pubsub
License: LGPL-3.0
Latest release: 1 day ago
Namespace: github.com/juju
Dependent packages: 2
Dependent repositories: 12
Stars: 22 on GitHub
Forks: 9 on GitHub
Docker dependents: 1
Docker downloads: 161
See more repository details: repos.ecosyste.ms
Last synced: 1 day ago