@Test public void addAndFlush1() throws CheckedFutureException { Continuation<Integer, Integer> c = newContinuation(); c.flush(Future.value(1)); assertEquals(new Integer(1), get(c)); }
@Override public final void flush(final Future<T> result) { WaitQueue<T> t = this; while (t instanceof WaitQueueHeadTail) { final WaitQueueHeadTail<T> l = (WaitQueueHeadTail<T>) t; l.head.flush(result); t = l.tail; } t.flush(result); }
WaitQueueHeadTail implements WaitQueue<T> { @Override public final void flush(final Future<T> result) { WaitQueue<T> t = this; while (t instanceof WaitQueueHeadTail) { final WaitQueueHeadTail<T> l = (WaitQueueHeadTail<T>) t; l.head.flush(result); t = l.tail; } t.flush(result); } }
WaitQueueHeadTail implements WaitQueue<T> { @Override public final void flush(final Future<T> result) { WaitQueue<T> t = this; while (t instanceof WaitQueueHeadTail) { final WaitQueueHeadTail<T> l = (WaitQueueHeadTail<T>) t; l.head.flush(result); t = l.tail; } t.flush(result); } WaitQueueHeadTail(final Continuation<T, ?> head, final WaitQueue<T> tail); }
WaitQueueHeadTail implements WaitQueue<T> { @Override public final void flush(final Future<T> result) { WaitQueue<T> t = this; while (t instanceof WaitQueueHeadTail) { final WaitQueueHeadTail<T> l = (WaitQueueHeadTail<T>) t; l.head.flush(result); t = l.tail; } t.flush(result); } WaitQueueHeadTail(final Continuation<T, ?> head, final WaitQueue<T> tail); @Override final WaitQueue<T> add(final Continuation<T, ?> c); @Override final void flush(final Future<T> result); @SuppressWarnings("unchecked") @Override final void forward(final Promise<T> target); }
WaitQueueHeadTail implements WaitQueue<T> { @Override public final void flush(final Future<T> result) { WaitQueue<T> t = this; while (t instanceof WaitQueueHeadTail) { final WaitQueueHeadTail<T> l = (WaitQueueHeadTail<T>) t; l.head.flush(result); t = l.tail; } t.flush(result); } WaitQueueHeadTail(final Continuation<T, ?> head, final WaitQueue<T> tail); @Override final WaitQueue<T> add(final Continuation<T, ?> c); @Override final void flush(final Future<T> result); @SuppressWarnings("unchecked") @Override final void forward(final Promise<T> target);  }