MCPcopy Create free account
hub / github.com/traneio/future / continuation

Method continuation

future-java/src/main/java/io/trane/future/Promise.java:307–325  ·  view source on GitHub ↗
(final Continuation<T, R> c)

Source from the content-addressed store, hash-verified

305 }
306
307 @SuppressWarnings("unchecked")
308 protected final <R> Future<R> continuation(final Continuation<T, R> c) {
309 while (true) {
310 final Object curr = state;
311 if (curr == null) {
312 if (cas(curr, c))
313 return c;
314 } else if (curr instanceof WaitQueue) {
315 if (cas(curr, ((WaitQueue<T>) curr).add(c)))
316 return c;
317 } else if (curr instanceof SatisfiedFuture) {
318 c.flush((SatisfiedFuture<T>) curr);
319 return c;
320 } else if (curr instanceof Promise && !(curr instanceof Continuation))
321 return ((Promise<T>) curr).continuation(c);
322 else if (curr instanceof LinkedContinuation)
323 return ((LinkedContinuation<?, T>) curr).continuation(c);
324 }
325 }
326
327 @SuppressWarnings("unchecked")
328 private final Promise<T> compress() {

Callers 15

mapMethod · 0.95
flatMapMethod · 0.95
transformMethod · 0.95
transformWithMethod · 0.95
biMapMethod · 0.95
biFlatMapMethod · 0.95
ensureMethod · 0.95
onSuccessMethod · 0.95
onFailureMethod · 0.95
respondMethod · 0.95
rescueMethod · 0.95
voidedMethod · 0.95

Calls 3

casMethod · 0.95
addMethod · 0.65
flushMethod · 0.65

Tested by

no test coverage detected