scijava / batch-processor

A Batch Processor for SciJava
BSD 2-Clause "Simplified" License
3 stars 0 forks source link

Implement Cancelable #7

Open imagejan opened 7 years ago

imagejan commented 7 years ago

Any batch processor command should implement org.scijava.Cancelable so that batch processing can be interrupted.

imagejan commented 6 years ago

ModuleBatchProcessor is a DynamicCommand, so it implements Cancelable.

However, there's currently no way to call its cancel() method during batch processing (and nothing checks isCanceled() during execution). Should we make ModuleBatchProcessor implement Task to achieve this (also to display a progress bar...) ?

The intended use case would be to (possibly) reuse the Kill button in the script editor to stop batch executions started with the Batch button; or to listen for the Esc key being pressed (by subscribing to the respective event using EventService?) whenever we run batch processing.

@ctrueden do you have advice regarding the "SciJava" way of doing this?