celery_longterm_scheduler | Schedules celery tasks to run | Monitoring library
kandi X-RAY | celery_longterm_scheduler Summary
kandi X-RAY | celery_longterm_scheduler Summary
Schedules celery tasks to run in the potentially far future
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Schedule this task .
- A context manager .
- Decode a dict .
- Runs the scheduler .
- Revoke a task .
- Set the state of the task .
- Factory function for longterm scheduler backend .
- Serialize timestamp to integer .
- Deserialize string .
- Serialize obj to pickle format .
celery_longterm_scheduler Key Features
celery_longterm_scheduler Examples and Code Snippets
Community Discussions
Trending Discussions on celery_longterm_scheduler
QUESTION
Suppose I have a model Event
. I want to send a notification (email, push, whatever) to all invited users once the event has elapsed. Something along the lines of:
ANSWER
Answered 2020-Apr-01 at 11:03We're doing something like this in the company i work for, and the solution is quite simple.
Have a cron / celery beat that runs every hour to check if any notification needs to be sent. Then send those notifications and mark them as done. This way, even if your notification time is years ahead, it will still be sent. Using ETA is NOT the way to go for a very long wait time, your cache / amqp might loose the data.
You can reduce your interval depending on your needs, but do make sure they dont overlap.
If one hour is too huge of a time difference, then what you can do is, run a scheduler every hour. Logic would be something like
- run a task (lets call this scheduler task) hourly that gets all notifications that needs to be sent in the next hour (via celery beat) -
- Schedule those notifications via apply_async(eta) - this will be the actual sending
Using that methodology would get you both of best worlds (eta and beat)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install celery_longterm_scheduler
You can use celery_longterm_scheduler like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page