Feature request: Task runner / job queue / durable functions with retry mechanics

Open
#5,205 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
30/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
postgresql, typescript
Domain
backend, databases

Research direction

Start by reading Nitro's existing task API and the related pull request #3237, both referenced in the issue. The request leaves the storage backend and integration approach open, so define how jobs persist across restarts and how retries, fatal errors, and failure logging fit the API before implementation.

Written by the indexing model from the issue text.

Description

pending triage
Describe the feature

It would be cool if Nitro could implement a job queue (also known as durable functions) that has retry mechanics. Or make it easier to implement one of the popular frameworks:

Required features:

  • Add a job to the queue that will execute the task
  • Retry on thrown error
  • Add fatal error that will not retry, example: Workflow SDK
  • Configure retry logic, e.g. staggered 10 s, 30 s, 60s, 10min, 60min, 6 hrs
  • Logging after specific amount of fails, e.g. "Task X failed 5 times"

Since Nitro already has a task api, possibly this one can be used? But tasks also have to be persistent after server restart which would require something like a kv or database.

Also, what Ive noticed with Graphile Worker is that it has a naming conflict: There "A 'task' is the type of work that a job may take", but when creating such tasks in Nitro, the folder ./tasks is already taken by Nitro tasks.

Possibly related to https://github.com/nitrojs/nitro/pull/3237

Additional information
  • Would you be willing to help implement this feature?
Dominant language
TypeScript
Stars
11.5k
Forks
968
Avg merge
4d 9h
Merged PRs (30d)
64

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nitrojs/nitro

All issues in nitrojs/nitro

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.