Let's say I have some unit of work that needs to get done and I want to do it asynchronously relative to the rest of my application because it can take a long time e.g. 10 seconds to 2 minutes. To accomplish this I'm considering two options:
- Schedule a Quartz job with a simple trigger set to fire only once and as soon as possible.
- Create a Runnable instance, hand it off to a Thread, and call
run();
.
In the context of the above I have the following questions:
- What does using the Quartz job get me that the thread doesn't have?
- What does using the runable get me that using the quartz job doesn't?
- In terms of best practices, what criteria ought be used for deciding between Quartz jobs and runnables for this use case?