Source code for superduperdb.backends.base.compute

import typing as t
from abc import ABC, abstractmethod, abstractproperty

[docs] class ComputeBackend(ABC): """ Abstraction for sending jobs to a distributed compute platform. """ @abstractproperty def type(self) -> str: """ Return the type of compute engine """ pass @abstractproperty def name(self) -> str: """ Return the name of current compute engine """ pass
[docs] def get_local_client(self): '''Returns a local version of self''' pass
[docs] @abstractmethod def submit(self, function: t.Callable, **kwargs) -> t.Any: """ Submits a function to the Dask server for execution. :param function: The function to be executed. :param kwargs: Additional keyword arguments to be passed to the function. """ pass
@abstractproperty def tasks(self) -> t.Any: """ List for all tasks """ pass
[docs] @abstractmethod def wait_all(self) -> None: """ Waits for all pending tasks to complete. """ pass
[docs] @abstractmethod def result(self, identifier: str) -> t.Any: """ Retrieves the result of a previously submitted task. Note: This will block until the future is completed. :param identifier: The identifier of the submitted task. """ pass
[docs] @abstractmethod def disconnect(self) -> None: """ Disconnect the client. """ pass
[docs] @abstractmethod def shutdown(self) -> None: """ Shuts down the compute cluster. """ pass