Skip to content

Commit

Permalink
Remove worker= kwarg
Browse files Browse the repository at this point in the history
Make client/worker mode mutually exclusive
  • Loading branch information
gjoseph92 committed Jun 22, 2021
1 parent e786f39 commit 5b63bdf
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions distributed/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,22 @@ class Actor(WrappedKey):
2
"""

def __init__(self, cls, address, key, worker=None):
def __init__(self, cls, address, key):
self._cls = cls
self._address = address
self.key = key
self._future = None
if worker:
self._worker = worker
self._client = None
else:
try:
self._worker = get_worker()
except ValueError:
self._worker = None
self._client = None
self._worker = None

try:
self._worker = get_worker()
except ValueError:
try:
self._client = get_client()
self._future = Future(key, inform=self._worker is None)
self._future = Future(key)
except ValueError:
self._client = None
pass

def __repr__(self):
return "<Actor: %s, key=%s>" % (self._cls.__name__, self.key)
Expand Down

0 comments on commit 5b63bdf

Please sign in to comment.