Skip to content
Snippets Groups Projects
Commit 628a087b authored by Christian Wulf's avatar Christian Wulf
Browse files

removed YieldStrategy

parent d4d46a43
No related branches found
No related tags found
No related merge requests found
......@@ -15,15 +15,10 @@
*/
package teetime.framework;
import teetime.framework.idle.IdleStrategy;
import teetime.framework.idle.YieldStrategy;
public abstract class AbstractConsumerStage<I> extends AbstractStage {
protected final InputPort<I> inputPort = this.createInputPort();
private IdleStrategy idleStrategy = new YieldStrategy(); // FIXME remove this word-around
public final InputPort<I> getInputPort() {
return this.inputPort;
}
......@@ -40,11 +35,4 @@ public abstract class AbstractConsumerStage<I> extends AbstractStage {
protected abstract void execute(I element);
public IdleStrategy getIdleStrategy() {
return idleStrategy;
}
public void setIdleStrategy(final IdleStrategy idleStrategy) {
this.idleStrategy = idleStrategy;
}
}
......@@ -100,13 +100,7 @@ public final class Analysis implements UncaughtExceptionHandler {
for (Stage stage : threadableStageJobs) {
switch (stage.getTerminationStrategy()) {
case BY_SIGNAL: {
RunnableConsumerStage runnable;
if (stage instanceof AbstractConsumerStage<?>) {
runnable = new RunnableConsumerStage(stage, ((AbstractConsumerStage<?>) stage).getIdleStrategy()); // FIXME remove this word-around
} else {
runnable = new RunnableConsumerStage(stage);
}
final Thread thread = new Thread(runnable);
final Thread thread = new Thread(new RunnableConsumerStage(stage));
stage.setOwningThread(thread);
this.consumerThreads.add(thread);
break;
......
......@@ -15,7 +15,6 @@
*/
package teetime.framework;
import teetime.framework.idle.YieldStrategy;
import teetime.framework.pipe.IPipeFactory;
import teetime.framework.pipe.PipeFactoryRegistry.PipeOrdering;
import teetime.framework.pipe.PipeFactoryRegistry.ThreadCommunication;
......@@ -50,7 +49,7 @@ class YieldStrategyConfiguration extends AnalysisConfiguration {
Relay<Object> relay = new Relay<Object>();
CollectorSink<Object> collectorSink = new CollectorSink<Object>();
relay.setIdleStrategy(new YieldStrategy());
// relay.setIdleStrategy(new YieldStrategy());
interThreadPipeFactory.create(producer.getOutputPort(), relay.getInputPort());
intraThreadPipeFactory.create(relay.getOutputPort(), collectorSink.getInputPort());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment