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
Replicate API: When you make a request to the Replicate API to process some data, it doesn't give you the result immediately because the processing takes time.
Webhook: Instead, the Replicate API allows you to specify a webhook. A webhook is like a callback URL that the API will call once it finishes processing the data.
Timeout Issues:
Vercel and Netlify: Our current hosting providers, Vercel and Netlify, will cut off any request that takes too long (25 seconds for Vercel, 10 seconds for Netlify). Since the processing by Replicate can take longer, we can't wait for the response directly in our initial API call.
Solution: Using Webhooks
Initial Request:
When the user makes a request to our API to process data with the Replicate API, our API immediately returns a response saying the request has been accepted.
Our API also stores some information to track this request.
Handling the Webhook:
We set up a new endpoint in our API to act as a webhook. The Replicate API will call this webhook once it has finished processing the data.
When our webhook endpoint receives the call, it updates the status of the original request with the result.
Additional context
No response
Participation
I am willing to submit a pull request for this feature.
The text was updated successfully, but these errors were encountered:
Describe the feature
Problem Overview
Solution: Using Webhooks
Additional context
No response
Participation
The text was updated successfully, but these errors were encountered: