ποΈ Deta Event Queue
π You can deploy this api completely free for any purpose and without limits on Deta.Sh Just click the link below π οΈ
Simple, reliable and free Event Queue Api.
π Check it on https://DetaEventQueue.deta.dev without any limits π
β© Example Usage: https://detaeventqueue.deta.dev/docs#/Send%20Your%20Event/receive_event_receive_event_post
Features and Advantages
- β Simple and powerfull for any type of app
- π³ Capable of handling over 2 000 000 events per day.
- β³οΈ Delaying execution time.
- π You don't have to use DetaEventQueue for just apps in Deta. You can use it in anywhere you want such as in Docker Container, an instance in Aws, DigitalOcean etc.
- π Don't make your visitor wait for long-running processes.
- ποΈ Increase your page speed easily.
- π Automatic retry if fails.
- π» Serverless so yo don't have to hassle with servers.
- π·οΈ Tagging events.
- π Get result of the event after execution.
For Demo:
- Go to: https://DetaEventQueue.deta.dev
- Password: demo
πTest It Now With a Simple Request
Use Cases
- Sending an email after signup that takes about 3 seconds
- Background jobs based on events such as
ticket created
,order received
,order shipped
etc. - Process data of the customer that takes time.
- Creating reports to users.
- Creating big files.
How It Works
- Send your events details to
/receive_event
endpoint.url_to_send_request
parameter will be called when execution the event. (Which can be something likehttps://example.com/url-to-call-for-the-event
)- Optional Parameters:
event_tags
: Default: [] Send tags of the event. (Example:["my-first-tag","My Second Tag"]
)call_url_after
: Default: 0 Delay the execution of the event. (For example send parameter as300
if you want to delay 5 minutes)timeout_for_request
: Default: 5 Change how many seconds to wait before timeout. (Can be from 1 to 6)max_try_count
: Default: 3 Change how many times to try. (Must be bigger or equal to 1)
- A cron which runs every minute will get events that has status of
waiting_execution
. - Try to send get request to the url.
- If url responds
within the timeout limits and a status code less then 300.
such as200
or201
- It will change event as
success
- Otherwise: it will retry after a minute
- It will change event as
- Status and details of any event can be checked at
/get-event
endpoint - Note: events with status of
success
andmax_try_count_reached
is deleted after 24 hours.
Deployment
How Event Key is Given?
- First Deta Base sorts data in key field from small to largest.
- So in order to get events in right sorting
- We subtract 100000000000 from the timestamp (when the event should be executed)
- Then we add uuid4 to the result (in order to prevent conflict of 2 events)
Check Api Documantation below: β¬οΈ
Swagger UI: https://DetaEventQueue.deta.dev/docs
π Example Projects Using with Deta Event Queue :
Contributing
Feel Free to contribute and add anything you want π
I'm checking pull requests daily.