You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by John Logan <Jo...@texture.com> on 2018/08/10 22:24:56 UTC

Detecting whether job has been stopped by the user but JobExecutor hasn't terminated yet?

Hi,


In essence I'm trying to detect the in-progress state of a job being stopped.


I see in the sling-event implementation that calling jobHandler.stopJobById() eventually works its way down to calling jobHandler.stop(), setting a flag in the JobHandler.


The JobExecutor is responsible for calling jobExecutionContext.isStopped(), and if it returns true, the JobExecutor should clean up, call  and exit.


There might be some time elapsed between the request to stop and the JobExecutor returning the JobExecutionResult that updates job state.  Is there a way to detect this interim condition via sling-event-api?  I had a look at the code and didn't see anything obvious.


What I'm trying to do is indicate in my UI that a job is being cancelled, but cancellation isn't complete yet.


Thanks!  John

Re: Detecting whether job has been stopped by the user but JobExecutor hasn't terminated yet?

Posted by Robert Munteanu <ro...@apache.org>.
Hi John,

You replied to Eugen's previous email which caused the email to appear
in the same thread, and likely ignored by at least some subscribers.

I don't have a good answer for your email, but maybe resending without
replying to an existing email might help :-)

Best,

Robert

On Fri, 2018-08-10 at 22:24 +0000, John Logan wrote:
> Hi,
> 
> 
> In essence I'm trying to detect the in-progress state of a job being
> stopped.
> 
> 
> I see in the sling-event implementation that calling
> jobHandler.stopJobById() eventually works its way down to calling
> jobHandler.stop(), setting a flag in the JobHandler.
> 
> 
> The JobExecutor is responsible for calling
> jobExecutionContext.isStopped(), and if it returns true, the
> JobExecutor should clean up, call  and exit.
> 
> 
> There might be some time elapsed between the request to stop and the
> JobExecutor returning the JobExecutionResult that updates job
> state.  Is there a way to detect this interim condition via sling-
> event-api?  I had a look at the code and didn't see anything obvious.
> 
> 
> What I'm trying to do is indicate in my UI that a job is being
> cancelled, but cancellation isn't complete yet.
> 
> 
> Thanks!  John