Improve max-worker sync-to-async handling.
- Dominant language
- Python
- Stars
- 2.7k
- Forks
- 292
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 3
Description
#422 ports the old `ASGI_THREADS` logic from `asgiref`. (C.f. #319)
Improvements:
* Move the initialisation of the default executor into `Server.run()` ([when configuring the loop](https://github.com/django/daphne/blob/6199d509c200cdd5102b39a3461a62984adebaf7/daphne/server.py#L131)).
* Adjust the test from #422 to set up the `Server` instance, so that's put into effect.
* Add a `--max-workers` CLI flag, with tests etc., to apply this.
* Deprecate the env var approach.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in daphne/server.py at the loop-configuration point linked in the issue, then inspect the test added for #422 and the existing CLI entry point. Verify that Server.run() applies the worker limit, that --max-workers is covered by tests, and that the environment-variable path is deprecated without breaking existing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100