draft: Add an optional REST Controller for Celery
This adds a Flask-based remote control for Celery as an extra bootstep
that is enabled by the Celery consumer blueprint (when the Celery worker
is started), when the rest_controller
flag is enabled in the Celery
config.
This remote-control enables the same operations as the celery inspect
and celery control
protocols, as GET and POST endpoints respectively.
TODO:
-
Improve thread management / exception passing (the Celery "shutdown" remote control just raises an exception, and waitress as WSGI server eats all exceptions; We could probably have a single WSGI thread, instead of a pair of WSGI "control" and WSGI "serving") -
basic unit testing
Edited by Nicolas Dandrimont