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

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

There is a newer version: 1.4.0
Show newest version
package com.github.lontime.extredisson.service;

import com.github.lontime.base.commonj.components.UndelayedProcessor;
import com.github.lontime.base.commonj.utils.LoggerHelper;
import com.github.lontime.extredisson.configuration.ConsumerOption;

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

    private DefaultStreamService service;

    public UndelayedConsumerProcessor(ConsumerOption consumerOptions) {
        this.service = new DefaultStreamService(consumerOptions);
    }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy