... | ... | @@ -40,4 +40,13 @@ This method will be called once by the framework before it executes the stage fo |
|
|
**Note:** You also need to make sure the super method is also called.
|
|
|
|
|
|
Finally, we want to terminate the stage.
|
|
|
Calling the method ``terminate`` will do so and additionally send a signal to all ongoing stages to terminate. |
|
|
Calling the method ``terminate`` will do so and additionally send a signal to all ongoing stages to terminate.
|
|
|
But do we need to do, if there is no kind of "termination point"?
|
|
|
In some cases, you want to execute something in an endless loop manner.
|
|
|
Take a look at the [Clock stage](https://build.se.informatik.uni-kiel.de/gitlab/teetime/teetime/blob/master/src/main/java/teetime/stage/Clock.java).
|
|
|
It generates endlessly elements and has not point where it terminates.
|
|
|
To indicate TeeTime this behavior, we need to modify the termination strategy of the stage.
|
|
|
By default, it terminates itself, like the InitialElementProducer of the example above.
|
|
|
In such cases like the Clock, we need to terminate it by interrupt.
|
|
|
To tell TeeTime this, simply override ```getTerminationStrategy()``` and return the Enum ```TerminationStrategy.BY_INTERRUPT```.
|
|
|
If the configuration terminates, this stage will be interrupted by the framework. |