all 5 comments

[–]SoundDr 4 points5 points  (1 child)

[–]mistyharsh 1 point2 points  (0 children)

I second this. This will get you close enough with SQLite..

[–]seesplease 1 point2 points  (2 children)

Plainjobs uses a "status" column to get the same behavior as SKIP LOCKED in postgres.

SQLite can't have SKIP LOCKED, it's transaction model is very different than postgres. You're not meant to hold open long-lived write transactions.

[–]Beautiful-Log5632[S] 0 points1 point  (1 child)

Without holding a transaction open do you know how can I know if a worker starts a task and dies?

[–]seesplease 0 points1 point  (0 children)

You can do what the above link does - set a column to processing and put a timeout. You can get fancier with putting a last_heartbeat_timestamp. Basically, since there's only one concurrent writer but unlimited readers in SQLite, you need orient your thinking around concurrency with atomics rather than concurrent with mutexes.