Minion job id opaqueness

27 views
Skip to first unread message

Flavio Poletti

unread,
Mar 14, 2018, 3:49:04 AM3/14/18
to Mojolicious
Hi!

While using Pg and SQLite backends, job ids are generated as incremental integers.

This ordering characteristic would come very handy in one application I'm writing. Is it something dependable, or should I consider ids as opaque for future-proofness?

To avoid the XY problem, some background: I'm scheduling jobs for deferred execution, but some of them might be superseded by new ones. I need a robust way to cope with races - "the last wins" being a perfect tactic.

Thanks, Flavio.

sri

unread,
Mar 14, 2018, 6:26:33 AM3/14/18
to Mojolicious
While using Pg and SQLite backends, job ids are generated as incremental integers.

This ordering characteristic would come very handy in one application I'm writing. Is it something dependable, or should I consider ids as opaque for future-proofness?

While it seems unlikely that ids in Minion::Backend::Pg will change, there are no
guarantees. And it can be very different from backend to backend.

--
sebastian

Flavio Poletti

unread,
Mar 14, 2018, 2:59:17 PM3/14/18
to mojol...@googlegroups.com
Thanks, I'll figure out something else to be on the safe side.

Flavio
Reply all
Reply to author
Forward
0 new messages