timgit / pg-boss

Queueing jobs in Postgres from Node.js like a boss
MIT License
2.13k stars 158 forks source link

Is pg_boss suitable for a scheduler-like mechanism #16

Closed Globik closed 7 years ago

Globik commented 7 years ago

Hi, just wondering wether the pg-boss is suitable for a scheduler-like mechanism? Say, job.publish in 30 minutes.

phips28 commented 7 years ago

I would say yes ;)

timgit commented 7 years ago

@Globik, you would be interested in {startIn: '30 minutes'} passed as options during publish() methinks

Globik commented 7 years ago

function ready() { boss.publish('work', {message: 'stuff'}, {startIn: '30 minutes'}) .then(jobId => console.log(sent job ${jobId}));?

Globik commented 7 years ago
  1. startIn must be integer 60603600 or human readable 'in twenty minutes'?
  2. Is table's field 'singletonOn' for the option 'startIn'?
timgit commented 7 years ago
  1. startIn is an either an int or a string which conforms to a PostgreSQL interval. Docs: https://github.com/timgit/pg-boss/wiki/Configuration#publish-options
  2. No. singletonOn is for throttling
Globik commented 7 years ago

Thank you very much for your explanations. One can close this issue. Very nice job.

timgit commented 7 years ago

Thanks

Globik commented 6 years ago

startIn does not work, startAfter is ok in version 3.0