Show subclass example in Adaptive docs
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 778
- Avg merge
- 2h 50m
- Merged PRs (30d)
- 3
Description
It'd be helpful to have a skeleton subclass of `Adaptive` in the documentation that users can copy conveniently. Right now, there are examples for subclassing `Cluster` but not `Adaptive`: [https://docs.dask.org/en/latest/setup/adaptive.html?highlight=adaptiv#distributed.deploy.Adaptive](https://docs.dask.org/en/latest/setup/adaptive.html?highlight=adaptiv#distributed.deploy.Adaptive)
Something like:
```
from distributed import Adaptive
class MyAdaptive(Adaptive):
async def workers_to_close(self, target: int):
"""
Get list of workers to close.
"""
async def recommendations(self, target: int) -> dict:
"""
Make scale up/down recommendations based on current state and target
"""
async def target(self):
"""
Determine target number of workers that should exist.
"""
```
Happy to create a PR for this.
Contributor guide
Assessment
This issue has not been assessed yet.