diff --git a/.ai/models/DistributedComputing.py b/.ai/models/DistributedComputing.py new file mode 100644 index 0000000..b04910e --- /dev/null +++ b/.ai/models/DistributedComputing.py @@ -0,0 +1,13 @@ +from dask.distributed import Client + +class DistributedComputing: + def __init__(self, client): + self.client = client + + def compute(self, func, data): + future = self.client.submit(func, data) + result = future.result() + return result + + def close(self): + self.client.close()