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

com.github.lontime.extredisson.container.UndelayedConsumerProcessor Maven / Gradle / Ivy

The newest version!
package com.github.lontime.extredisson.container;

import com.github.lontime.base.commonj.components.UndelayedProcessor;
import com.github.lontime.base.logging.GLogger;
import com.github.lontime.extredisson.configuration.ConsumerOption;

/**
 * UndelayedConsumerProcessor.
 * @author lontime
 * @since 1.0
 */
public class UndelayedConsumerProcessor extends UndelayedProcessor {

    private RealConsumeHandler handler;

    public UndelayedConsumerProcessor(ConsumerOption consumerOptions) {
        this.handler = new RealConsumeHandler(consumerOptions);
    }

    @Override
    protected void startUp() {
        GLogger.defaults().info(getClass(), "startUp state {0}", currentState());
        if (handler != null) {
            handler.initialize();
        }
    }

    @Override
    public boolean doLoop() {
        if (handler != null) {
            return handler.doLoop();
        }
        return false;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy