We have operations that take up to several hours and output status information to the console. Did anyone implement a clever way how to check whether the user wants to terminate the long running command?
Am 19.04.2013 13:41, schrieb Marcel Bruch:
> Did anyone implement a clever way how to check whether the user wants to terminate the long running command?
I usually implement those long running things in an Eclipse Job. The
commands schedule such a job and keep a reference somewhere (eg. in a
registry or singleton variable). Another commands then looks up the
reference and cancels the job.
Within the job, you need to check the progress monitor for cancellation.
Am 20.04.2013 09:18, schrieb Marcel Bruch:
> Looks like we are going to convert some or our commands to jobs soon.
Everything in the console is executed within the console thread. Thus,
the console connection executing a long running task is basically
"locked". I'm not aware of any option (such as ctrl+c on bash) to
interrupt the current thread.