Skip to content

Conversation

vicb
Copy link
Contributor

@vicb vicb commented Sep 2, 2025

The self reference refers to the current worker

{
"binding": "WORKER_SELF_REFERENCE",
"service": "middleware",
"service": "main-server",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's wasn't the case actually, we still need it to go through the middleware in some cases like res.revalidate.
The queue should be able to call directly here, but i'm not sure it's the right thing to do even in this case. It means exposing something that is supposed to not be accessible without going through the middleware/routing layer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the doc to make it clear that referencing the middleware is not a typo.
PTAL

@vicb vicb changed the title docs(cloudflare): fix WORKER_SELF_REFERENCE in the multi-worker setup docs(cloudflare): clarify WORKER_SELF_REFERENCE in the multi-worker setup Sep 2, 2025
@vicb
Copy link
Contributor Author

vicb commented Sep 2, 2025

Thanks for the reviews!

@vicb vicb merged commit c1c83d0 into main Sep 2, 2025
1 check passed
@vicb vicb deleted the vicb/mcw-f1 branch September 2, 2025 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants