21.4.1 Daemon Work and non-daemon Work
In WorkManager, you can create two types of Work such as the daemon Work (long-life Work) and the non-daemon Work (short-life Work). An overview of each Work is as follow:
-
The daemon Work is created when you execute the schedule method and Work continues even if the request processing of a servlet or EJB ends. The daemon Work is destroyed when WorkManager ends. The daemon Work is always executed with a newly created thread and not with threads in the thread pool.
-
Non-daemon Work (short-life Work)
The non-daemon Work is created when you execute the schedule method and Work is destroyed when processing of the run method ends. For the non-daemon Work, use threads and queues that are managed in the thread pool.