com.github.lontime.extredisson.service.UndelayedConsumerProcessor Maven / Gradle / Ivy
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;
}
}