All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yoloho.schedule.extension.task.AbstractRedisQueueMultiTask Maven / Gradle / Ivy

The newest version!
package com.yoloho.schedule.extension.task;

import java.util.Comparator;
import java.util.List;

import com.yoloho.schedule.interfaces.IScheduleTaskDealMulti;
import com.yoloho.schedule.types.TaskItem;

/**
 * 任务的抽象类,提供以redis为队列的简单抽象
 * 
 * @author jason @ Jan 4, 2019
 *
 */
public abstract class AbstractRedisQueueMultiTask extends AbstractRedisQueueTask
        implements IScheduleTaskDealMulti {
    
    @Override
    public List selectTasks(String taskParameter, String ownSign, int taskItemNum, List taskItemList,
            int eachFetchDataNum) throws Exception {
        return getTaskList(eachFetchDataNum);
    }
    
    protected abstract boolean processItems(T[] items);
    
    @Override
    public boolean execute(T[] items, String ownSign) throws Exception {
        return processItems(items);
    }
    
    @Override
    public Comparator getComparator() {
        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy