Skip to content
Discussion options

You must be logged in to vote

Hi @arthurvanl!

Yes, repeated jobs work natively in embedded mode — no setInterval needed. When you pass repeat: { every: N } in the job options, bunqueue's internal handleRepeat() automatically schedules the next execution after each completion.

const queue = new Queue('my-queue', { embedded: true });

// This works perfectly in embedded mode
await queue.add('recurring-task', { key: 'value' }, {
  repeat: { every: 5000 },  // every 5 seconds
});

The flow is:

  1. Job is added and processed by Worker
  2. On completion, handleRepeat() pushes a new job with delay = repeat.every
  3. After the delay, the new job becomes available for processing
  4. Repeat until limit is reached (if set)

So what you're seein…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by arthurvanl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants