-
Notifications
You must be signed in to change notification settings - Fork 651
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Paolo Di Tommaso <[email protected]>
- Loading branch information
1 parent
0014db9
commit 3e21298
Showing
4 changed files
with
81 additions
and
14 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
modules/nextflow/src/main/groovy/nextflow/extension/LastOp.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package nextflow.extension | ||
|
||
/** | ||
* | ||
* @author Paolo Di Tommaso <[email protected]> | ||
*/ | ||
class LastOp { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,15 +23,15 @@ import groovy.transform.CompileStatic | |
import groovy.util.logging.Slf4j | ||
import groovyx.gpars.dataflow.DataflowReadChannel | ||
import groovyx.gpars.dataflow.DataflowWriteChannel | ||
import groovyx.gpars.dataflow.operator.ChainWithClosure | ||
import groovyx.gpars.dataflow.operator.CopyChannelsClosure | ||
import groovyx.gpars.dataflow.operator.DataflowEventAdapter | ||
import groovyx.gpars.dataflow.operator.DataflowProcessor | ||
import nextflow.Channel | ||
import nextflow.Global | ||
import nextflow.Session | ||
import nextflow.extension.op.Op | ||
|
||
/** | ||
* Implement "take" operator | ||
* | ||
* @author Paolo Di Tommaso <[email protected]> | ||
*/ | ||
|
@@ -73,11 +73,16 @@ class TakeOp { | |
} | ||
} | ||
|
||
newOperator( | ||
inputs: [source], | ||
outputs: [target], | ||
listeners: (length > 0 ? [listener] : []), | ||
new ChainWithClosure(new CopyChannelsClosure())) | ||
final params = new OpParams() | ||
.withInput(source) | ||
.withOutput(target) | ||
if( length>0 ) | ||
params.withListener(listener) | ||
|
||
newOperator(params) { | ||
final proc = getDelegate() as DataflowProcessor | ||
Op.bind(proc, target, it) | ||
} | ||
|
||
return target | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters