buildgrid.server.threading module

class buildgrid.server.threading.ContextThreadPoolExecutor(max_workers: int | None = None, thread_name_prefix: str = '', initializer: Callable[[], Any] | None = None, initargs: Tuple[Any, ...] = (), immediate_copy: bool = False)

Bases: ThreadPoolExecutor

submit(fn: Callable[_P, _T], *args: _P.args, **kwargs: _P.kwargs) Future[_T]

Submits a callable to be executed with the given arguments.

Schedules the callable to be executed as fn(*args, **kwargs) and returns a Future instance representing the execution of the callable.

Returns:

A Future representing the given call.

class buildgrid.server.threading.ContextThread(target: Callable[_P, _T], name: str | None = None, args: Iterable[Any] = (), kwargs: Dict[str, Any] | None = None, *, daemon: bool | None = None)

Bases: Thread

class buildgrid.server.threading.ContextWorker(target: Callable[[Event], None], name: str | None = None, *, on_shutdown_requested: Callable[[], None] | None = None)

Bases: object

is_alive() bool
start() None
stop() None
wait(timeout: float | None = None) None