Skip to content

Instantly share code, notes, and snippets.

@riga
Last active April 23, 2020 09:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riga/cfaec1ffa2cadf373925fa89be0f33c5 to your computer and use it in GitHub Desktop.
Save riga/cfaec1ffa2cadf373925fa89be0f33c5 to your computer and use it in GitHub Desktop.
# coding: utf-8
"""
Command to run the tasks:
luigi --module progress_tasks TaskB --workers 2
"""
import time
import luigi
class TaskA(luigi.Task):
interval = luigi.IntParameter()
def run(self):
self.set_status_message("some task message")
for i in range(100):
self.set_progress_percentage(i)
time.sleep(self.interval)
class TaskB(luigi.WrapperTask):
def requires(self):
return [TaskA(interval=2), TaskA(interval=4)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment