Add Queue binding method to create event subscriptions at runtime #14733
jkahn117
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Current Behavior
Queue event subscriptions can only be created via the REST API (
POST /accounts/{account_id}/event_subscriptions/subscriptions) or the wrangler queues subscription create CLI command. There is no way to create or manage subscriptions dynamically from within a Worker using the Queue binding.Desired Behavior
Add a
subscribe()method (and optionallyunsubscribe()) to theQueuebinding so that Workers can dynamically create event subscriptions at runtime:Proposed Type Definitions (workers-sdk)
API Reference
The underlying REST API already supports this via
POST /accounts/{account_id}/event_subscriptions/subscriptionsandDELETE /accounts/{account_id}/event_subscriptions/subscriptions/{subscription_id}. This feature would expose that capability through the binding.Related
Use Cases
All reactions