Skip to content
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

🚀 Feature Request: Allow user-uploaded workers to register as queue consumers #6758

Open
jasonbarry opened this issue Sep 19, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@jasonbarry
Copy link

Describe the solution

There's no indication that user-uploaded scripts cannot be queue consumers, however in practice that seems to be the case (please correct me if that's not true or if there's an undocumented workaround!).

The Create Queue Consumer endpoint doesn't work if you pass in the name of a user-uploaded script. That script lives within the Workers for Platforms namespace, so it makes sense that the script cannot be found. But there doesn't exist an endpoint under the Workers for Platforms section that lets user workers register as queue consumers.

Similarly, there doesn't exist a binding type in the Upload API that binds a user worker to a queue consumer -- the queue type only binds workers to queue producers.

If user-uploaded scripts could be bound to a queue consumer, it would unlock some pretty powerful workflows! As it stands, the queue() method defined in a user-uploaded worker's default export is currently unreachable, as far as I understand it. Thanks for your time and consideration!

@jasonbarry jasonbarry added the enhancement New feature or request label Sep 19, 2024
@penalosa
Copy link
Contributor

penalosa commented Nov 8, 2024

To clarify, is this with Workers for Platforms? This should work with normal workers, as far as I know

@jasonbarry
Copy link
Author

@penalosa Yes, this is for WfP. I've since worked around this by putting the queue consumer in the dispatch worker, and then forwarding all requests in a POST call to the relevant user workers.

My two cents for the resolution of this issue is to add a paragraph in https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/platform/limits/ that states that the queue() handler (and potentially other non-fetch handlers?) are not reachable when deployed as a user worker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants