+ def wait_all_and_start(group):
+ reschedule = False
+ for guid in group:
+ rm = self.get_resource(guid)
+ if rm.state < ResourceState.READY:
+ reschedule = True
+ break
+
+ if reschedule:
+ callback = functools.partial(wait_all_and_start, group)
+ self.schedule("1s", callback)
+ else:
+ # If all resources are read, we schedule the start
+ for guid in group:
+ rm = self.get_resource(guid)
+ self.schedule("0.01s", rm.start_with_conditions)
+
+ if wait_all_ready:
+ # Schedule the function that will check all resources are
+ # READY, and only then it will schedule the start.
+ # This is aimed to reduce the number of tasks looping in the scheduler.
+ # Intead of having N start tasks, we will have only one
+ callback = functools.partial(wait_all_and_start, group)
+ self.schedule("1s", callback)
+