New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run long tasks in background #57
Comments
Addendum, with celery it would be easy to make the rabbitmq/redis dependency optional and run tasks in the flask process when it is not available. |
I'd rather not have to use redis, do you know of any more lightweight alternatives? Maybe we could use threads... 🤔 |
Agree with keeping it simple for now, we could also use Python3's built-in |
Yes I think using asyncio is a good idea |
I agree! |
It seems that flask and werkzeug don't play nice with asyncio, because werkzeug is blocking by design.
That doesn't mean we cannot use custom coroutines/threading/multiprocessing, though. |
https://docs.python.org/3/library/concurrent.futures.html#module-concurrent.futures seems to provide what we need here, any opinions? https://flask-executor.readthedocs.io/en/latest/ shows how it could be implemented (not necessarily by using that extension directly) |
We're about to do this refactor on ArchiveBox too, we're looking at theses 2 queue systems primarily:
There are also adapters that link them to Flask I think (I know there are adapters for Django, should be easy to adapt if no flask-specific ones). I'm rooting hard for Archivy, it looks like you've managed to avoid a lot of the early mistakes that plagued the ArchiveBox codebase, the UI is gorgeous, and your plugin system is awesome. I'd love to share notes/lessons we learned from ours so that you can avoid those pitfalls. |
Thanks for the suggestions!
Yes I'd definitely loved to collaborate, and I remember your comments on the post I made about Archivy on Hacker News, back in August. Your work with ArchiveBox is really cool :) |
Ah yeah sorry I forgot to follow up after I initially commented on HN, got swamped with work. I'll join your discord and we can continue the convo there :) |
Cool! |
Some of the work archivy does should run asynchronously from the web server:
Some possible solutions:
Celery
This would add a dependency to either rabbitmq or redis, which might not match your vision for archivy as a simple app. On the other hand, redis might be useful for other stuff (like a cache for a text-search system easier to install than ES)
Python-RQ
(much) More minimalist design, using redis: official website
The text was updated successfully, but these errors were encountered: