from __future__ import annotations

from typing import Any, Callable

class TaskBatch:
    def __init__(self, pool: Any, flush_threshold: int = 100, priority: int = 0, group: int = 0) -> None: ...
    def add(self, fn: Callable[..., Any], args: tuple[Any, ...] | None = None, kwargs: dict[str, Any] | None = None, priority: int = 0) -> None: ...
    def flush(self) -> int: ...
    def pending(self) -> int: ...

class TaskGroup:
    def __init__(self, pool: Any) -> None: ...
    def submit(self, fn: Callable[..., Any], args: tuple[Any, ...] | None = None, kwargs: dict[str, Any] | None = None, priority: int = 0) -> None: ...
    def stats(self) -> dict[str, int]: ...
