As I understand, yielding a task within the run method will guarantee that the yielded task completes before the yielding task continues. However, yielding a task in requires() does not have this effect -- it seems that tasks yielded from requires are all scheduled concurrently.
Is there any fundamental reason for this difference in behavior? If requires behaved like run then WrapperTask would be more expressive -- you could for example express simple combinations of sequential pipelines and fan-in/fan-out behavior with less boilerplate:
class SimplePipeline(WrapperTask):
def requires(self):
yield SetupTask() # wait to finish
yield [FanOut() for i in range(5)] # schedule concurrently, wait to finish
yield Reducer()
Also, naively I would assume that the behavior of yielding a task would be easier to understand, since run and requires would do the same thing (though maybe I'm missing some subtlety here).
cheers,
Chris