Job queue as SQL table with multiple consumers (PostgreSQL)

后端 未结 7 804
醉梦人生
醉梦人生 2020-12-04 09:34

I have a typical producer-consumer problem:

Multiple producer applications write job requests to a job-table on a PostgreSQL database.

The job requests have

相关标签:
7条回答
  • 2020-12-04 10:35

    what about just select?

    SELECT * FROM table WHERE status = 'QUEUED' LIMIT 10 FOR UPDATE SKIP LOCKED;
    

    https://www.postgresql.org/docs/9.5/static/sql-select.html#SQL-FOR-UPDATE-SHARE

    0 讨论(0)
提交回复
热议问题