Cloudflare docs: queue handlers in custom workers#202
Open
JoshuaKirby88 wants to merge 1 commit intoopennextjs:mainfrom
Open
Cloudflare docs: queue handlers in custom workers#202JoshuaKirby88 wants to merge 1 commit intoopennextjs:mainfrom
JoshuaKirby88 wants to merge 1 commit intoopennextjs:mainfrom
Conversation
Document using runWithCloudflareRequestContext in queue handlers and add a cross-link to the caching page.
There was a problem hiding this comment.
Pull request overview
This pull request adds documentation for implementing queue handlers in custom Cloudflare workers while maintaining access to the Next.js request context. The changes enable developers to process queue messages with the same context helpers (getCloudflareContext(), headers(), cookies()) available in regular HTTP requests.
Changes:
- Added a comprehensive guide showing how to implement queue handlers using
runWithCloudflareRequestContext - Provided a complete code example demonstrating message reconstruction from queue metadata
- Added a cross-reference link from the caching page to guide users who need this pattern
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pages/cloudflare/howtos/custom-worker.mdx | Added new section "Queue handlers with Next.js request context" with complete implementation example and explanation |
| pages/cloudflare/caching.mdx | Added cross-reference link to the custom worker how-to for users processing queue messages |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
runWithCloudflareRequestContextso queue processing runs inside the Next.js/OpenNext request context.Requestfrom queue message metadata and calls application code with the usual context helpers.