-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds background job scheduling and execution #11238
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ted when using schedule/success/failure/clear
…n rw-jobs` behaves the same
Josh-Walker-GM
approved these changes
Aug 21, 2024
Tobbe
reviewed
Aug 21, 2024
|
||
You'll most likely be scheduling work as the result of one of your service functions being executed. Let's say we want to schedule our `SampleJob` whenever a new user is created: | ||
|
||
```js title="api/src/services/users/users.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add TS versions of all code listings as well (as we do for our tutorial, so the user gets an option to switch between TS and JS)
dac09
added a commit
to dac09/redwood
that referenced
this pull request
Aug 22, 2024
…into feat/rw-uploads-extension * 'feat/rw-uploads-extension' of github.com:dac09/redwood: chore(test-fixture): correct rebuild script string suffix substitution (redwoodjs#11339) refactor(forms): Build with esbuild and add conditional exports (redwoodjs#11338) refactor(prerender): build with esbuild and introduce conditional exports (redwoodjs#11337) Adds more tests! Refactor rw-jobs-worker (redwoodjs#11335) refactor(auth-providers): switch to esbuild for some 'web' packages (redwoodjs#11334) Jobs doc updates (redwoodjs#11333) chore(ci): Split formatting check into separate job (redwoodjs#11332) Updates caching doc code snippets to be consistent (redwoodjs#11331) chore(tsconfig): Properly link to api-server's tsconfig (redwoodjs#11330) Adds background job scheduling and execution (redwoodjs#11238) [gh11317] Added documentation for working with Jest and Alias Paths (redwoodjs#11323) fix(record): Update dependencies and build dual esm/cjs (redwoodjs#11300) chore(build): Consistent tsconfig and buildinfo naming for CJS (redwoodjs#11326) chore(test): Fix RSC server cell smoke test (redwoodjs#11327) chore(playwright): Make RSC tests less flakey (redwoodjs#11325) chore(ci): Temporary fix for format checking on all PRs (redwoodjs#11324) chore(build): Move more repetitive code into framework-tools (redwoodjs#11320) chore(docs): fix docs formatting (redwoodjs#11321)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This new package provides scheduling and processing of background jobs. We want everything needed to run a modern web application to be included in Redwood itself—you shouldn't need any third party integrations if you don't want.
Background jobs have been sorely missed, but the time has come! (If you do want to use a third party service we have had an integration with Inngest since May of 2023!)
Features
api/src/lib/logger
or create a new one just for job logging.Usage
Check out the docs!
The Future
beforePerform()
,afterPerform()
,afterSuccess()
,afterFailure()
TODO
Thanks to @Josh-Walker-GM for the help in the recent refactor!
Closes #11122