Skip to content

Commit

Permalink
Create DistributedComputing.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Jul 5, 2024
1 parent 55fb9f3 commit 094bf9a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .ai/models/DistributedComputing.py
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit 094bf9a

Please sign in to comment.