@Override public final void run() { if (owner == currentThread()) { try { process(); } catch (Throwable t) { onError(t); } } else { // the pipeline is executed on the wrong IOThread, so send the // pipeline to the right IO Thread to be executed. addTaskAndWakeup(this); } }
@Override public final void run() { if (owner == currentThread()) { try { process(); } catch (Throwable t) { onError(t); } } else { // the pipeline is executed on the wrong IOThread, so send the // pipeline to the right IO Thread to be executed. addTaskAndWakeup(this); } }
private void processSelectionKey(SelectionKey sk) { NioPipeline pipeline = (NioPipeline) sk.attachment(); try { if (!sk.isValid()) { // if the selectionKey isn't valid, we throw this exception to feedback the situation into the pipeline.onFailure throw new CancelledKeyException(); } // we don't need to check for sk.isReadable/sk.isWritable since the pipeline has only registered // for events it can handle. eventCount.inc(); pipeline.process(); } catch (Throwable t) { pipeline.onError(t); } }
private void processSelectionKey(SelectionKey sk) { NioPipeline pipeline = (NioPipeline) sk.attachment(); try { if (!sk.isValid()) { // if the selectionKey isn't valid, we throw this exception to feedback the situation into the pipeline.onFailure throw new CancelledKeyException(); } // we don't need to check for sk.isReadable/sk.isWritable since the pipeline has only registered // for events it can handle. eventCount.inc(); pipeline.process(); } catch (Throwable t) { pipeline.onError(t); } }