zlacker

[parent] [thread] 2 comments
1. amarsh+(OP)[view] [source] 2021-12-17 23:48:25
It’s also possible to use advisory locks to implement a job queue in Postgres. See e.g. Que[1]. Note there are a fair number of corner cases, so studying Que is wise if trying to implement something like this, as well as some (a bit older) elaboration[2].

We implemented a similar design to Que for a specific use case in our application that has a known low volume of jobs and for a variety of reasons benefits from this design over other solutions.

[1]: https://github.com/que-rb/que [2]: https://brandur.org/postgres-queues

replies(1): >>bjt+Li
2. bjt+Li[view] [source] 2021-12-18 02:21:10
>>amarsh+(OP)
There's something even nicer than advisory locks, as of a few years ago. https://www.2ndquadrant.com/en/blog/what-is-select-skip-lock...
replies(1): >>amarsh+wr
◧◩
3. amarsh+wr[view] [source] [discussion] 2021-12-18 03:51:55
>>bjt+Li
Some comments from brandur on SKIP LOCKED in https://github.com/brandur/sorg/pull/263. I haven’t looked into it too much since what we have works without any issues; but good to know, thanks!
[go to top]