-
Notifications
You must be signed in to change notification settings - Fork 597
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
Add queue binding type for workers scripts #1176
Add queue binding type for workers scripts #1176
Conversation
changelog detected ✅ |
Codecov Report
@@ Coverage Diff @@
## master #1176 +/- ##
==========================================
- Coverage 49.40% 49.35% -0.05%
==========================================
Files 127 128 +1
Lines 12290 12432 +142
==========================================
+ Hits 6072 6136 +64
- Misses 4840 4892 +52
- Partials 1378 1404 +26
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Changelog entry added! As far as the API docs go, the workers script upload endpoint is documented (https://api.cloudflare.com/#worker-script-upload-worker) but it looks like it does not specifically cover each individual binding type. I'm not sure if this repo contains documentation for the various workers binding types, but LMK if so and I can add a description. |
// WorkerQueueBinding is a binding to a Workers Queue. | ||
// | ||
// https://developers.cloudflare.com/workers/platform/bindings/#queue-bindings | ||
type WorkerQueueBinding struct { |
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.
How are we differentiating between a producer
and consumer
binding? https://developers.cloudflare.com/queues/configuration/
Should we add an optional sub-resource to allow folks to configure the consumer? Something like https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloudfunctions_function#event_trigger
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.
This PR is only for the producer
side of Queues config. I'll tackle all the consumer stuff separately, but yeah we are going to need to define a new type of sub-resource for consumers. Basically I was thinking that a script could have two sub resources: queue_bindings
and queue_consumers
(names could be changed...) that would handle each type.
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.
@jbw1991 are you planning on tackling queue consumers anytime soon?
6689fc7
to
d95c40c
Compare
This functionality has been released in v0.59.0. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
Description
Adds the Queue binding type. Workers scripts use this binding to write messages to a Queue.
Has your change been tested?
Types of changes
What sort of change does your code introduce/modify?
Checklist: