from celery.concurrency.base import BasePool
from typing import Any

def process_initializer(app: Any, hostname: Any) -> None: ...
def process_destructor(pid: Any, exitcode: Any) -> None: ...

class TaskPool(BasePool):
    Pool: Any = ...
    BlockingPool: Any = ...
    uses_semaphore: bool = ...
    write_stats: Any = ...
    on_apply: Any = ...
    maintain_pool: Any = ...
    terminate_job: Any = ...
    grow: Any = ...
    shrink: Any = ...
    flush: Any = ...
    def on_start(self) -> None: ...
    def restart(self) -> None: ...
    def did_start_ok(self): ...
    def register_with_event_loop(self, loop: Any): ...
    def on_stop(self) -> None: ...
    def on_terminate(self) -> None: ...
    def on_close(self) -> None: ...
    @property
    def num_processes(self): ...
