Ecosyste.ms: Packages

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

Top 6.7% on proxy.golang.org
Top 5.0% forks on proxy.golang.org

proxy.golang.org : github.com/blokur/harego

Package harego contains the logic for communicating with RabbitMQ. A Client wraps an exchange and a queue in a concurrent safe manner for managing all communications with RabbitMQ. If the Client doesn't have a queue name set, it will not create a queue. Zero value is not usable, therefore a Client should be constructed with NewClient() function. The only requirement for an Client to operate is a connector that returns a connection to the broker. There is also a helper function that can create a new connection from the address of the broker. The Client will create 1 worker by default for publishing and consuming messages. The default exchange of the Client is "default" and it is set woth the "topic" type. The default delivery method is persistent. You can use provided ConfigFunc functions to change the Client's behaviour. You should call the Close() method when you are done with this object, otherwise it leaks goroutines. NewClient returns an Client instance. You can configure the object by providing ConfigFunc functions. See ConfigFunc documentation for more information. Queue names are not needed for publishing messages. If the client is setup with multiple workers, each Publish call will go through the next available worker. To use the Consume method, you need to provide a queue name. The Client will bind the queue to the exchange, then Consume calls the handler with the next available message on the next available worker. It stops handling messages when the context is done or the client is closed. Consume internally creates another worker for requeueing messages. By default messages are consumed with false autoAck. Make sure you have enough workers so the Consume is not clogged on delays.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/blokur/harego
Keywords: amqp, go, golang, library, rabbitmq
License: Apache-2.0
Latest release: over 1 year ago
First release: almost 4 years ago
Namespace: github.com/blokur
Stars: 9 on GitHub
Forks: 4 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 2 days ago

    Loading...
    Readme
    Loading...