Skip to content

Commit

Permalink
feat(PassOn): a simple task that immediately passes its input
Browse files Browse the repository at this point in the history
This is used for connecting tasks into slightly difficult ways.
  • Loading branch information
jrs65 committed Dec 21, 2023
1 parent 58efa6a commit 548cb07
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions draco/core/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,3 +298,15 @@ def setup(self, input_):
def next(self, input_):
"""Immediately forward any input."""
return input_


class PassOn(task.MPILoggedTask):
"""Unconditionally forward a tasks input.
While this seems like a pointless no-op it's useful for connecting tasks in complex
topologies.
"""

def next(self, input_):
"""Immediately forward any input."""
return input_

0 comments on commit 548cb07

Please sign in to comment.