/** * Callback to notify that future is finished. * This method must delegate to {@link #onDone(GridNioFuture, Throwable)} method. * * @param res Result. */ public final void onDone(GridNioFuture<R> res) { onDone(res, null); }
/** * Callback to notify that future is finished. Note that if non-{@code null} exception is passed in * the result value will be ignored. * * @param delegate Optional result. * @param err Optional error. */ public void onDone(@Nullable GridNioFuture<R> delegate, @Nullable Throwable err) { assert delegate != null || err != null; if (err != null) onDone(err); else delegate.listen(new IgniteInClosure<IgniteInternalFuture<R>>() { @Override public void apply(IgniteInternalFuture<R> t) { try { onDone(t.get()); } catch (IgniteCheckedException e) { onDone(e); } } }); }
/** * Flushes all deferred write events. * @throws GridNioException If failed to forward writes to the filter. */ void flushDeferredWrites() throws IgniteCheckedException { assert isHeldByCurrentThread(); assert handshakeFinished; while (!deferredWriteQueue.isEmpty()) { WriteRequest req = deferredWriteQueue.poll(); req.future().onDone((GridNioFuture<Object>)parent.proceedSessionWrite(ses, req.buffer(), true, req.ackC)); } }
embFut.onDone(origFut, null);
/** * Callback to notify that future is finished. * This method must delegate to {@link #onDone(GridNioFuture, Throwable)} method. * * @param res Result. */ public final void onDone(GridNioFuture<R> res) { onDone(res, null); }
/** * Callback to notify that future is finished. Note that if non-{@code null} exception is passed in * the result value will be ignored. * * @param delegate Optional result. * @param err Optional error. */ public void onDone(@Nullable GridNioFuture<R> delegate, @Nullable Throwable err) { assert delegate != null || err != null; if (err != null) onDone(err); else delegate.listen(new IgniteInClosure<IgniteInternalFuture<R>>() { @Override public void apply(IgniteInternalFuture<R> t) { try { onDone(t.get()); } catch (IgniteCheckedException e) { onDone(e); } } }); }
/** * Flushes all deferred write events. * @throws GridNioException If failed to forward writes to the filter. */ void flushDeferredWrites() throws IgniteCheckedException { assert isHeldByCurrentThread(); assert handshakeFinished; while (!deferredWriteQueue.isEmpty()) { WriteRequest req = deferredWriteQueue.poll(); req.future().onDone((GridNioFuture<Object>)parent.proceedSessionWrite(ses, req.buffer(), true, req.ackC)); } }