1

I have a web application that runs locally only (does not run on a remote server). The web application is basically just a ui to adjust settings and see some information about the main application. Web UI was used as opposed to a native application due to portability and ease of development. Now, in order to start and stop the main application, I want to achieve this through a button in the web application. However, I couldn't find a suitable way to start a asynchronous and managed task locally. I saw there is a library called celery, however that seems to be suitable to a distributed environment, which mine is not.

My main need to be able to start/stop the task, as well as the check if the task is running (so I can display that in the ui). Is there any way to achieve this?

1 Answer 1

1

celery can work just fine locally. Distributed is just someone else's computer after all :)

You will have to install all the same requirements and the like. You can kick off workers by hand, or as a service, just like in the celery docs.

Sign up to request clarification or add additional context in comments.

2 Comments

Won't it be a bit overkill though? It seems weird to setup rabbitMQ (or some other message queue), and other dependencies used for distribution, while I won't be using any of that functionality. I was thinking there might be a simpler way to do it.
rabbitMQ is there to handle message calls to celery workers. Its the pub-sub that lets you pass tasks to the workers and prevents two workers from grabbing the same task. If rabbitMQ itself seems over complicated, you can look at alternatives like redis. There are some async options in python3, but I have never used them, so I can't say how well they work. Here are the docs docs.python.org/3/library/asyncio-task.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.