Link Search Menu Expand Document

Reasons for an explicit flow

In DiFlow, we do not allow multiple input Channels, but rather make the flow of data explicit by means of the available Channel operators. There are a few reasons for this:

  1. It’s easier to use a consistent API for modules, so that we don’t need to know how to call a module
  2. This makes for cleaner view on what a pipeline does by looking at the pipeline code
  3. The asynchronous nature of the computations may cause inconsistencies

Let us illustrate the latter point a bit more in detail. In what follows we define the same process in two scenarios: once where we allow two input process and once where we define the flow explicitly using the join operator.

First the process that takes two inputs:

Such that


```sh
> nextflow -q run . -entry join_process -with-dag figures/join_process.png
WARN: DSL 2 IS AN EXPERIMENTAL FEATURE UNDER DEVELOPMENT -- SYNTAX MAY CHANGE IN FUTURE RELEASE
[[1, 11/d], [2, 21/c], [3, 31/b], [4, 41/a]]

The second implementation seems to do the same:

Such that


```sh
> nextflow -q run . -entry join_stream -with-dag figures/join_stream.png
WARN: DSL 2 IS AN EXPERIMENTAL FEATURE UNDER DEVELOPMENT -- SYNTAX MAY CHANGE IN FUTURE RELEASE
[[1, 11a], [2, 21b], [3, 31c], [4, 41d]]