Skip to content

Commit

Permalink
Wording fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ulzha committed Jul 11, 2018
1 parent cee2841 commit ed27ffc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions luigi/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,17 +259,16 @@ def terminate(self):
return super(TaskProcess, self).terminate()


# TODO be composable with arbitrarily many custom context managers?
# Introduce a convention shared for extension points other than TaskProcess?
# Use https://docs.openstack.org/stevedore?
# This code and the task_process_context config key currently feels a bit ad-hoc.
# Discussion on generalizing it into a plugin system: https://github.com/spotify/luigi/issues/1897
class ContextManagedTaskProcess(TaskProcess):
def __init__(self, context, *args, **kwargs):
super(ContextManagedTaskProcess, self).__init__(*args, **kwargs)
self.context = context

def run(self):
if self.context:
logger.debug('Instantiating ' + self.context)
logger.debug('Importing module and instantiating ' + self.context)
module_path, class_name = self.context.rsplit('.', 1)
module = importlib.import_module(module_path)
cls = getattr(module, class_name)
Expand Down

0 comments on commit ed27ffc

Please sign in to comment.