Ecosyste.ms: Packages

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

Top 4.3% on proxy.golang.org
Top 4.2% dependent packages on proxy.golang.org
Top 2.9% dependent repos on proxy.golang.org
Top 5.8% forks on proxy.golang.org
Top 1.4% docker downloads on proxy.golang.org

proxy.golang.org : github.com/prep/beanstalk

Package beanstalk provides a beanstalk client. The Producer is used to put jobs into tubes. It provides a connection pool: Putting a job in a tube is done by calling Put, which will select a random connection for its operation: If a Put operation fails on a connection, another connection in the pool will be selected for a retry. The Consumer is used to reserve jobs from tubes. It provides a connection pool: The ratio of Multiply and NumGoroutines is important. Multiply determines the size of the connection pool and NumGoroutines determines how many reserved jobs you have in-flight. If you have a limited number of connections, but a high number of reserved jobs in-flight, your TCP connection pool might experience congestion and your processing speed will suffer. Although the ratio depends on the speed by which jobs are processed, a good rule of thumb is 1:10. Reserve jobs from the tubes specified in NewConsumer is done by calling Receive, which will reserve jobs on any of the connections in the pool: If the context passed to Receive is cancelled, Receive will finish processing the jobs it has reserved before returning. When Receive offers a job the goroutine is responsible for processing that job and finishing it up. A job can either be deleted, released or buried: If the Producer and Consumer abstractions are too high, then Conn provides the lower level abstraction of a single connection to a beanstalk server: The Config structure offers hooks for info and error logs that allows hooking in to a custom log solution. NewProducer, NewConsumer and Dial take a URI or a list of URIs as their first argument, who can be described in various formats. In the above examples the beanstalk server was referenced by the host:port notation. This package also supports URI formats like beanstalk:// for a plaintext connection, and beanstalks:// or tls:// for encrypted connections. In the case of encrypted connections, if no port has been specified it will default to port 11400 as opposed to the default 11300 port.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/prep/beanstalk
Keywords: beanstalk, go, golang, golang-package
License: BSD-3-Clause
Latest release: over 1 year ago
First release: about 6 years ago
Namespace: github.com/prep
Dependent packages: 2
Dependent repositories: 3
Stars: 24 on GitHub
Forks: 13 on GitHub
Docker dependents: 5
Docker downloads: 481
See more repository details: repos.ecosyste.ms
Last synced: 7 days ago

    Loading...
    Readme
    Loading...