michaelklishin/quartzite

Graceful shutdown

theikkila opened this issue · 5 comments

I'm working with application that uses quartzite as scheduling jobs.

The job is triggered by time interval and it takes few minutes to finish itself.

If the program is retrieving shutdown signal it stops scheduler by (shutdown scheduler) but now the running job is just closed without notifying anyone.

Is it possible to monitor the jobs state or wait if job is running to finish it?

In quartz there is @DisallowConcurrentExecution-annotation. Is it possible to use that with quartzite?

I was trying to create a job that uses the @DisallowConcurrentExecution annotation and stumbled across this question. Its still not clear to me how to do it. @michaelklishin can you clarify how its possible? The equivalent code in quartz would be:

@DisallowConcurrentExecution
public class YourJob implements org.quartz.Job {
    void execute(JobExecutionContext context) {/*implementation omitted*/}
}

thanks!

@sthomp have you seen the link above? The function linked to is how you perform a graceful scheduler shutdown.

@DisallowConcurrentExecution is NOT a direct alternative. Using annotations in Clojure requires class generation, so it may be easier to just implement your job(s) in Java.

yeah i saw the linked code. I guess this is a different question then. mainly wondering how to declare jobs that cannot run concurrently.

@sthomp via Java interop or in Java.