-
Notifications
You must be signed in to change notification settings - Fork 14
Empty tasks #355
Comments
FYI You can already do this today. The dependency operator val pre = if (doPre) Some(Pre(...)) else None
...
root => pre => thing ==> post |
Agreed, so do pipes, but these do not always solve my use case. When scatter gathering, I basically want a conditional gather. For example, I may scatter across libraries, analyze each independently, then group the libraries by sample, and only run a task for sample that had more than one library: val sampleScatter = libraryScatter
.map { library => analyzeLibrary(library) }
.groupBy { library => (library.sampleName, library.libraryId }
.map { case (_, libraries) => analyzeSample(libraries) } // returns a task per sample
sampleScatter.gather { samples => // a Seq of tasks, one per sample
if (samples.exists(_.libraries.size > 1) /** do something */ else NoOpTask
} Another example would be where this is allowed:
which will fail in dagr! |
I'm curious why your second example will fail? Both |
Dagr doesn’t like tasks that return an empty sequence of tasks. I’ll look into it. |
I think I also want the |
Just like we have
EmptyDependable
, I would like anEmptyTask
, which does nothing (doesn't need to be run). I can then a task that conditionally runs, without having to implement a sillySimpleInJvmTask
that does nothing.The text was updated successfully, but these errors were encountered: