Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pyro annotations for lsi_worker #968

Merged
merged 1 commit into from
Oct 20, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions gensim/models/lsi_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Worker(object):
def __init__(self):
self.model = None


@Pyro4.expose
def initialize(self, myid, dispatcher, **model_params):
self.lock_update = threading.Lock()
self.jobsdone = 0 # how many jobs has this worker completed?
Expand All @@ -49,7 +49,7 @@ def initialize(self, myid, dispatcher, **model_params):
logger.info("initializing worker #%s" % myid)
self.model = lsimodel.LsiModel(**model_params)


@Pyro4.expose
@Pyro4.oneway
def requestjob(self):
"""
Expand Down Expand Up @@ -81,7 +81,7 @@ def processjob(self, job):
fname = os.path.join(tempfile.gettempdir(), 'lsi_worker.pkl')
self.model.save(fname)


@Pyro4.expose
@utils.synchronous('lock_update')
def getstate(self):
logger.info("worker #%i returning its state after %s jobs" %
Expand All @@ -90,7 +90,7 @@ def getstate(self):
self.finished = True
return self.model.projection


@Pyro4.expose
@utils.synchronous('lock_update')
def reset(self):
logger.info("resetting worker #%i" % self.myid)
Expand Down