com.spikeify.taskqueue.service.TaskThreadPoolContext Maven / Gradle / Ivy
                 Go to download
                
        
                    Show more of this group  Show more artifacts with this name
Show all versions of taskqueue Show documentation
                Show all versions of taskqueue Show documentation
Taskqueue service utilizing Spikeify with Aerospike database
                
             The newest version!
        
        package com.spikeify.taskqueue.service;
import com.spikeify.taskqueue.TaskContext;
import java.util.concurrent.ScheduledThreadPoolExecutor;
/**
 * Thread context for job execution ... holds thread information
 */
public class TaskThreadPoolContext implements TaskContext {
	private final ScheduledThreadPoolExecutor executor;
	private boolean timeOut;
	public TaskThreadPoolContext(ScheduledThreadPoolExecutor executorService) {
		executor = executorService;
	}
	@Override
	public boolean interrupted() {
		return timeOut || executor.isTerminating();
	}
	@Override
	public void interrupt() {
		timeOut = true;
	}
	public void reset() {
		timeOut = false;
	}
}
    © 2015 - 2025 Weber Informatics LLC | Privacy Policy