nat.front_ends.fastapi.dask_client_mixin#

Classes#

DaskClientMixin

Helper class that provides a standard way to create an ABC using

Module Contents#

class DaskClientMixin#

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

async client(
address: str,
) collections.abc.AsyncGenerator[dask.distributed.Client]#

Async context manager for obtaining a Dask client.

Yields#

Client

An async Dask client connected to the scheduler. The client is automatically closed when exiting the context manager.

blocking_client(
address: str,
) collections.abc.Generator[dask.distributed.Client]#

context manager for obtaining a blocking Dask client.

Yields#

Client

A blocking Dask client connected to the scheduler. The client is automatically closed when exiting the context manager.