Comments (5)
@oliviersels I can help with this feature, once you open the PR I can work on it.
Not sure what are the use cases for delayed asynchronous tasks, but one of the most important thing, I think is have the ability to unload jobs/tasks into a queue where there can wait for being picked up.
I like your approach to handle delayed async, I would make a little suggestion:
"dev": {
..
"async_source": "zappa.async.LambdaAsync",
"async_policy": "cost-effective",
..
}
}
async_policy
allowed values:
- cost-effective, it will decide based on the delayed amount whether to use
sqs
< 15min delay, or AWS step functions to > 15 min delay - sqs always use sqs
- step always use step functions
from zappa.
Not sure what are the use cases for delayed asynchronous tasks
We use it extensively in our projects for sending reminders to customers. For example:
@task(delay_seconds=60*60*24) # Delay 24 hours
def send_reminder(user):
"""Check to see if user performed action, otherwise send reminder"""
one of the most important thing, I think is have the ability to unload jobs/tasks into a queue where there can wait for being picked up.
In many cases, SNS already supports this queuing and fanout functionality, including retries, filtering and dead-letter queue handling. I no longer suggest adding SQS as an async source, or maybe only in a different PR, after this one.
I like your approach to handle delayed async, I would make a little suggestion:
"dev": { .. "async_source": "zappa.async.LambdaAsync", "async_policy": "cost-effective", .. } }
async_policy
allowed values:
- cost-effective, it will decide based on the delayed amount whether to use
sqs
< 15min delay, or AWS step functions to > 15 min delay- sqs always use sqs
- step always use step functions
I'm reluctant to add configuration settings for the async_source
as I don't see the need for it if we can contain it in a single class.
{
"dev": {
..
"async_source": "zappa.async.SfnOrLambdaAsync",
or
"async_source": "zappa.async.CostEffectiveAsync",
or
"async_source": "zappa.async.SnsAsync",
or
"async_source": "myproject.AwesomeAsync",
..
}
}
from zappa.
In many cases, SNS already supports this queuing and fanout functionality, including retries, filtering and dead-letter queue handling. I no longer suggest adding SQS as an async source, or maybe only in a different PR, after this one.
I have no use case for delayed invocations, but I'd like to give my vote for adding SQS as an async source: I'm not an AWS expert but in my mind:
- SQS is for queues where a given message is only consumed by a single consumer
- SNS is for pub-sub
Meaning SQS is a better fit for a background task queue. Although SQS and SNS have lots of overlap, it just seems to me that in the long run SQS is going to be the option that people want to use for background tasks.
from zappa.
Hi there! Unfortunately, this Issue has not seen any activity for at least 90 days. If the Issue is still relevant to the latest version of Zappa, please comment within the next 10 days if you wish to keep it open. Otherwise, it will be automatically closed.
from zappa.
Hi there! Unfortunately, this Issue was automatically closed as it had not seen any activity in at least 100 days. If the Issue is still relevant to the latest version of Zappa, please open a new Issue.
from zappa.
Related Issues (20)
- django.server logs are not shown in CloudWatch - Using Zappa HOT 3
- Enpoint request timedout error (Django deployed with zappa) HOT 2
- API Gateway Resource Policy limits with too many scheduled events HOT 2
- zappa certify → AttributeError: 'NoneType' object has no attribute 'split' HOT 7
- Please create 'version' command that prints zappa version HOT 3
- There's no obvious way to join the Zappa slack HOT 5
- Add direct support for Amazon secrets manager HOT 5
- Tiktoken package for openai script not working HOT 3
- Python 3.12 not supported
- Python 3.12 is not supported HOT 1
- Python3.12 is not supported HOT 1
- Provide better error message for the user's failure to run `pip freeze
- Incorrect CLI Error Messaging
- Zappa tries to create new S3 bucket when it can't access the already existing one
- SQS event creating when it should be updating
- Implement OICD authentication for PyPi package publishing
- zappa task is not working asyncronous on recurlsive call HOT 1
- Set cloudwatch retention period
- Python 3.10 not supported in latest package version HOT 3
- S3 bucket is not reused with `slim_handler: True`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zappa.