3 ms·
I love PG job queues! They’re surprisingly easy to implement in plain SQL: [1] https://taylor.town/pg-task https://taylor.town/pg-task The nice thing about t
by surprisetalk 3y ago
I love PG job queues!
They’re surprisingly easy to implement in plain SQL:
[1] https://taylor.town/pg-task https://taylor.town/pg-task
The nice thing about this implementation is that you can query within the same transaction window
- rockwotj 3y agoAgreed. Shortwave [1] is built completely on this, but with the added layer of having a leasing system that is per user on top of the tasks. So you only need to `SKIP LOCKED` to grab a lease, then you can grab as many tasks as you want and process them in bulk. It allows higher throughput of tasks, and also was required for the use case as the leases where tied to a user and tasks for a single user must be processed in order. [1]: https://www.shortwave.com/ https://www.shortwave.com/