com.lmax.disruptor.dsl.EventHandlerGroup Java Examples

The following examples show how to use com.lmax.disruptor.dsl.EventHandlerGroup. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DefaultDisruptorConfig.java    From disruptor-spring-manager with MIT License 6 votes vote down vote up
private void disruptorEventHandlerChain() {
	for(int i=0;i<eventHandlerChain.length;i++){
		EventHandlerChain<T> eventHandlersChain = eventHandlerChain[i];
		EventHandlerGroup<T> eventHandlerGroup = null;
		if(i == 0){
			eventHandlerGroup = getDisruptor().handleEventsWith(eventHandlersChain.getCurrentEventHandlers());
		}else{
			eventHandlerGroup = getDisruptor().after(eventHandlersChain.getCurrentEventHandlers());
		}
		
		if(! ArrayUtils.isEmpty(eventHandlersChain.getNextEventHandlers())){
			eventHandlerGroup.then(eventHandlersChain.getNextEventHandlers());
		}
	}
	
	getEventProcessorGraph();
}
 
Example #2
Source File: DisruptorUtil.java    From nuls with MIT License 4 votes vote down vote up
public EventHandlerGroup<T> handleEventsWithWorkerPool(String name, WorkHandler<DisruptorData>... handler) {
    Disruptor disruptor = DISRUPTOR_MAP.get(name);
    AssertUtil.canNotEmpty(disruptor, "the disruptor is not exist!name:" + name);
    return disruptor.handleEventsWithWorkerPool(handler);
}
 
Example #3
Source File: DisruptorUtil.java    From nuls with MIT License 4 votes vote down vote up
public EventHandlerGroup<T> handleEventWith(String name, EventHandler<T> eventHandler) {
    Disruptor disruptor = DISRUPTOR_MAP.get(name);
    AssertUtil.canNotEmpty(disruptor, "the disruptor is not exist!name:" + name);
    return disruptor.handleEventsWith(eventHandler);
}
 
Example #4
Source File: DisruptorUtil.java    From nuls with MIT License 4 votes vote down vote up
public EventHandlerGroup<T> after(String name, EventHandler<T> eventHandler) {
    Disruptor disruptor = DISRUPTOR_MAP.get(name);
    AssertUtil.canNotEmpty(disruptor, "the disruptor is not exist!name:" + name);
    return disruptor.after(eventHandler);
}