Ecosyste.ms: Packages

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

Top 2.7% on proxy.golang.org
Top 2.5% dependent packages on proxy.golang.org
Top 1.7% dependent repos on proxy.golang.org
Top 3.5% forks on proxy.golang.org

proxy.golang.org : github.com/bgentry/que-go

Package que-go is a fully interoperable Golang port of Chris Hanks' Ruby Que queueing library for PostgreSQL. Que uses PostgreSQL's advisory locks for speed and reliability. See the original Que documentation for more details: https://github.com/chanks/que Because que-go is an interoperable port of Que, you can enqueue jobs in Ruby (i.e. from a Rails app) and write your workers in Go. Or if you have a limited set of jobs that you want to write in Go, you can leave most of your workers in Ruby and just add a few Go workers on a different queue name. Instead of using database/sql and the more popular pq PostgreSQL driver, this package uses the pgx driver: https://github.com/jackc/pgx Because Que uses session-level advisory locks, we have to hold the same connection throughout the process of getting a job, working it, deleting it, and removing the lock. Pq and the built-in database/sql interfaces do not offer this functionality, so we'd have to implement our own connection pool. Fortunately, pgx already has a perfectly usable one built for us. Even better, it offers better performance than pq due largely to its use of binary encoding. que-go relies on prepared statements for performance. As of now these have to be initialized manually on your connection pool like so: If you have suggestions on how to cleanly do this automatically, please open an issue! Here is a complete example showing worker setup and two jobs enqueued, one with a delay:

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/bgentry/que-go
License: MIT
Latest release: over 6 years ago
First release: almost 8 years ago
Namespace: github.com/bgentry
Dependent packages: 5
Dependent repositories: 10
Stars: 316 on GitHub
Forks: 48 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 13 days ago

    Loading...
    Readme
    Loading...