You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement webhook functionality for the task queue system, allowing users to receive task status updates without having to poll the /tasks/get/{task_id} endpoint.
Justification/Rationale
Reduced Polling Overhead: By enabling webhooks, users won’t need to continuously poll the task status endpoint. This reduces server load, unnecessary API calls, and network traffic.
Timely Notifications: Users can receive immediate updates on the task status (e.g., when a task is completed or fails), leading to better automation and workflow efficiency.
Proposed Implementation (if any)
Webhook Subscription:
When deferring a task using defer=True, users should be able to provide a webhook_url as an additional query parameter. This URL would be stored along with the task and used to send webhook notifications when the task status changes.
Example API call:
POST /some-endpoint?defer=True&webhook_url=https://example.com/webhook-handler
Event Trigger:
When a task changes status (to "completed" or "failed"), the system should trigger a POST request to the registered webhook URL.
Payload Structure:
Send a simple JSON payload with the status and task information. An example payload:
{
"task_id": "{task_id}",
"status": "completed", // or "failed""timestamp": "{timestamp}"
}
Failure Notifications:
If the task fails, the webhook should notify the user by sending a status of "failed" with additional error information.
Retry Mechanism:
Implement a retry mechanism for webhook delivery in case the receiving server is down or unreachable.
The text was updated successfully, but these errors were encountered:
Feature Summary
Implement webhook functionality for the task queue system, allowing users to receive task status updates without having to poll the
/tasks/get/{task_id}
endpoint.Justification/Rationale
Reduced Polling Overhead: By enabling webhooks, users won’t need to continuously poll the task status endpoint. This reduces server load, unnecessary API calls, and network traffic.
Timely Notifications: Users can receive immediate updates on the task status (e.g., when a task is completed or fails), leading to better automation and workflow efficiency.
Proposed Implementation (if any)
Webhook Subscription:
Event Trigger:
Payload Structure:
Failure Notifications:
"failed"
with additional error information.Retry Mechanism:
The text was updated successfully, but these errors were encountered: