sanic-org / sanic

Accelerate your web app development | Build fast. Run fast.

Home Page:https://sanic.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to add custom worker processed managed by Sanic

Tronic opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe.

Suggesting an easy facility to have the main process start app processes and restart them on server restart (perhaps optionally).

Describe the solution you'd like

@app.worker_process
def worker(app):
    ...

Additional context

Process termination, graceful restarts etc. might need something more that should then also be handled by Sanic. These would need to be started and managed even when using Sanic.serve_single().