Module iu.util
Package edu.iu

Class IuUtilityTaskController<T>

java.lang.Object
edu.iu.IuUtilityTaskController<T>
Type Parameters:
T - result type
All Implemented Interfaces:
UnsafeSupplier<T>

public class IuUtilityTaskController<T> extends Object implements UnsafeSupplier<T>
Controller for executing utility tasks.

A utility task is timed, potentially blocking, and non-business critical. For example, establishing a database connection. Utility tasks are not required to complete before the JVM can exit.

To ensure threads are tied to the lowest level parent group possible, the utility executor should be initialized by the main bootstrap method or closest reasonable equivalent, i.e., ServletListener, as in the example below.

 Class.forName(IuUtilityWorkloadController.class.getName());
 

Implementation Note: The executor backing this workload controller is deliberately small and cannot be configured. Utility tasks should typically complete in 5ms or less under normal environment conditions, and only run into exhaustion issues when downstream resources slow down. The small size of the utility executor allow RejectedExecutionException provide fail-fast behavior as preferable to destabilizing the entire application.