from celery import bootsteps
from celery.utils.threads import bgThread
from typing import Any, Optional

class WorkerComponent(bootsteps.StartStopStep):
    label: str = ...
    conditional: bool = ...
    requires: Any = ...
    enabled: Any = ...
    def __init__(self, w: Any, **kwargs: Any) -> None: ...
    def create(self, w: Any): ...
    def register_with_event_loop(self, w: Any, hub: Any) -> None: ...
    def info(self, w: Any): ...

class Autoscaler(bgThread):
    pool: Any = ...
    mutex: Any = ...
    max_concurrency: Any = ...
    min_concurrency: Any = ...
    keepalive: Any = ...
    worker: Any = ...
    def __init__(self, pool: Any, max_concurrency: Any, min_concurrency: int = ..., worker: Optional[Any] = ..., keepalive: Any = ..., mutex: Optional[Any] = ...) -> None: ...
    def body(self) -> None: ...
    def maybe_scale(self, req: Optional[Any] = ...) -> None: ...
    def update(self, max: Optional[Any] = ..., min: Optional[Any] = ...): ...
    def force_scale_up(self, n: Any) -> None: ...
    def force_scale_down(self, n: Any) -> None: ...
    def scale_up(self, n: Any): ...
    def scale_down(self, n: Any): ...
    def info(self): ...
    @property
    def qty(self): ...
    @property
    def processes(self): ...
