Package cn.sliew.milky.common.chain
Interface Command<K,V>
-
- All Known Implementing Classes:
LogCommand
public interface Command<K,V>没有添加netty的@Shareable特性,如果Command被添加如多个pipeline,需要Command处理并发等问题
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidexceptionCaught(AbstractPipelineProcess<K,V> process, Context<K,V> context, CompletableFuture<?> future, Throwable cause)Gets called if aThrowablewas thrown.voidonEvent(AbstractPipelineProcess<K,V> process, Context<K,V> context, CompletableFuture<?> future)Execute a unit of processing work to be performed.
-
-
-
Method Detail
-
onEvent
void onEvent(AbstractPipelineProcess<K,V> process, Context<K,V> context, CompletableFuture<?> future)
Execute a unit of processing work to be performed.A command may either complete the required processing and just return or call async future, or delegate remaining processing to the subsequent command in the enclosing
Pipelineby continue fire event.- Parameters:
process- The command context through wholePipelinecontext- TheContextto be processed by thisCommandfuture- The result container and async listener- Throws:
PipelineException- general purpose exception return to indicate abnormal terminationIllegalArgumentException- ifcontextisnull
-
exceptionCaught
void exceptionCaught(AbstractPipelineProcess<K,V> process, Context<K,V> context, CompletableFuture<?> future, Throwable cause) throws PipelineException
Gets called if aThrowablewas thrown.- Throws:
PipelineException
-
-