Skip to content

Commit 1cd6fce

Browse files
committed
Rename CombineManyOp -> MergeWithEachOp
Signed-off-by: Ben Sherman <[email protected]>
1 parent 8a3a827 commit 1cd6fce

File tree

3 files changed

+25
-27
lines changed

3 files changed

+25
-27
lines changed

modules/nextflow/src/main/groovy/nextflow/extension/CombineManyOp.groovy renamed to modules/nextflow/src/main/groovy/nextflow/extension/MergeWithEachOp.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import nextflow.Channel
3535
*/
3636
@Slf4j
3737
@CompileStatic
38-
class CombineManyOp {
38+
class MergeWithEachOp {
3939

4040
private List<DataflowReadChannel> sources
4141

@@ -65,7 +65,7 @@ class CombineManyOp {
6565

6666
private transient List<List> combinations
6767

68-
CombineManyOp(List<DataflowReadChannel> sources, List<Integer> iterators) {
68+
MergeWithEachOp(List<DataflowReadChannel> sources, List<Integer> iterators) {
6969
this.sources = sources
7070
this.iterators = iterators
7171
this.queues = sources.collect( ch -> [] )

modules/nextflow/src/main/groovy/nextflow/processor/TaskProcessor.groovy

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ class TaskProcessor {
663663
task.cached = true
664664
session.notifyTaskCached(new StoredTaskHandler(task))
665665

666-
// -- now bind the results
666+
// -- now emit the results
667667
finalizeTask0(task)
668668
return true
669669
}
@@ -748,7 +748,7 @@ class TaskProcessor {
748748
if( entry )
749749
session.notifyTaskCached(new CachedTaskHandler(task,entry.trace))
750750

751-
// -- now bind the results
751+
// -- now emit the results
752752
finalizeTask0(task)
753753
return true
754754
}
@@ -1162,49 +1162,48 @@ class TaskProcessor {
11621162
}
11631163

11641164
/**
1165-
* Bind the expected output files to the corresponding output channels
1166-
* @param processor
1165+
* Emit the expected outputs to the corresponding output channels
11671166
*/
1168-
synchronized protected void bindOutputs( TaskRun task ) {
1167+
synchronized protected void emitOutputs( TaskRun task ) {
11691168

1170-
// bind the output
1169+
// -- emit the output
11711170
if( isFair0 ) {
1172-
fairBindOutputs0(task.outputs, task)
1171+
fairEmitOutputs0(task.outputs, task)
11731172
}
11741173
else {
1175-
bindOutputs0(task.outputs)
1174+
emitOutputs0(task.outputs)
11761175
}
11771176

1178-
// -- finally prints out the task output when 'debug' is true
1177+
// -- finally print the task output when 'debug' is true
11791178
if( task.config.debug ) {
11801179
task.echoStdout(session)
11811180
}
11821181
}
11831182

1184-
protected void fairBindOutputs0(List emissions, TaskRun task) {
1183+
protected void fairEmitOutputs0(List emissions, TaskRun task) {
11851184
synchronized (isFair0) {
11861185
// decrement -1 because tasks are 1-based
11871186
final index = task.index-1
1188-
// store the task emission values in a buffer
1187+
// store the task output values in a buffer
11891188
fairBuffers[index-currentEmission] = emissions
1190-
// check if the current task index matches the expected next emission index
1189+
// check if the current task index matches the expected next output index
11911190
if( currentEmission == index ) {
11921191
while( emissions!=null ) {
1193-
// bind the emission values
1194-
bindOutputs0(emissions)
1192+
// emit the output values
1193+
emitOutputs0(emissions)
11951194
// remove the head and try with the following
11961195
fairBuffers.remove(0)
1197-
// increase the index of the next emission
1196+
// increase the index of the next output
11981197
currentEmission++
1199-
// take the next emissions
1198+
// take the next output
12001199
emissions = fairBuffers[0]
12011200
}
12021201
}
12031202
}
12041203
}
12051204

1206-
protected void bindOutputs0(List outputs) {
1207-
// -- bind out the collected values
1205+
protected void emitOutputs0(List outputs) {
1206+
// -- emit the output values
12081207
for( int i = 0; i < config.getOutputs().size(); i++ ) {
12091208
final param = config.getOutputs()[i]
12101209
final value = outputs[i]
@@ -1780,7 +1779,7 @@ class TaskProcessor {
17801779

17811780
/**
17821781
* Finalize the task execution, checking the exit status
1783-
* and binding output values accordingly
1782+
* and emitting output values accordingly
17841783
*
17851784
* @param task The {@code TaskRun} instance to finalize
17861785
*/
@@ -1832,17 +1831,16 @@ class TaskProcessor {
18321831

18331832
/**
18341833
* Finalize the task execution, checking the exit status
1835-
* and binding output values accordingly
1834+
* and emitting output values accordingly
18361835
*
18371836
* @param task The {@code TaskRun} instance to finalize
1838-
* @param producedFiles The map of files to be bind the outputs
18391837
*/
18401838
private void finalizeTask0( TaskRun task ) {
18411839
log.trace "Finalize process > ${safeTaskName(task)}"
18421840

1843-
// -- bind output (files)
1841+
// -- emit outputs
18441842
if( task.canBind ) {
1845-
bindOutputs(task)
1843+
emitOutputs(task)
18461844
publishOutputs(task)
18471845
}
18481846

modules/nextflow/src/main/groovy/nextflow/script/ProcessDef.groovy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import nextflow.NF
2525
import nextflow.Session
2626
import nextflow.exception.ScriptRuntimeException
2727
import nextflow.extension.CH
28-
import nextflow.extension.CombineManyOp
28+
import nextflow.extension.MergeWithEachOp
2929
import nextflow.script.dsl.ProcessConfigBuilder
3030

3131
/**
@@ -167,7 +167,7 @@ class ProcessDef extends BindableDef implements IterableDef, ChainableDef {
167167
}
168168

169169
final iterators = (0..<declaredInputs.size()).findAll( i -> declaredInputs[i].isIterator() )
170-
return CH.getReadChannel(new CombineManyOp(declaredInputs.getChannels(), iterators).apply())
170+
return CH.getReadChannel(new MergeWithEachOp(declaredInputs.getChannels(), iterators).apply())
171171
}
172172

173173
private void collectOutputs(boolean singleton) {

0 commit comments

Comments
 (0)