sanic icon indicating copy to clipboard operation
sanic copied to clipboard

Ability to add custom worker processed managed by Sanic

Open Tronic opened this issue 7 months ago • 0 comments

Is there an existing issue for this?

  • [X] 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().

Tronic avatar Nov 20 '23 03:11 Tronic