Re:System design hack: Postgres is a great pub/sub and job s...
by ris on Friday November 08, 2019 @08:52PM
(#21488997)
I used to do something a little like this with postgres advisory locks. Worker takes out a lock that signifies it's working on a task, if the worker fails or loses its connection in any way the lock gets dropped along with the transaction being rolled back.
Example: https://gist.github.com/risicle/f4807bd706c9862f69aa