public class ReturnOrAwait<T> extends Object
FrameProcessor.runIncrementally(it.unimi.dsi.fastutil.ints.IntSet), and are used by
FrameProcessorExecutor to manage execution.
An instance can be a "return" with a result, which means that the FrameProcessor is done working.
In this case isReturn() is true and value() contains the result.
An instance can also be an "await", which means that the FrameProcessor wants to be scheduled again
in the future. In this case isAwait() is true, awaitSet() contains the set of input channels to
wait for, and isAwaitAll() is whether the processor wants to wait for all channels, or any channel.| Modifier and Type | Method and Description |
|---|---|
static <T> ReturnOrAwait<T> |
awaitAll(int count)
Wait for all of a certain number of channels.
|
static <T> ReturnOrAwait<T> |
awaitAll(it.unimi.dsi.fastutil.ints.IntSet await)
Wait for all provided channels to become readable (or finished).
|
static <T> ReturnOrAwait<T> |
awaitAny(it.unimi.dsi.fastutil.ints.IntSet await)
Wait for any of the provided channels to become readable (or finished).
|
it.unimi.dsi.fastutil.ints.IntSet |
awaitSet()
The set of channels the processors wants to wait for.
|
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isAwait()
Whether the processor wants to be scheduled again.
|
boolean |
isAwaitAll()
Whether the processor wants to wait for all channels in
awaitSet() (true), or any channel (false) |
boolean |
isReturn()
Whether the processor has returned a value.
|
static <T> ReturnOrAwait<T> |
returnObject(T o)
Return a result.
|
static <T> ReturnOrAwait<T> |
runAgain()
Wait for nothing; that is: run again as soon as possible.
|
String |
toString() |
T |
value()
The returned result.
|
public static <T> ReturnOrAwait<T> runAgain()
public static <T> ReturnOrAwait<T> awaitAll(it.unimi.dsi.fastutil.ints.IntSet await)
FrameProcessor.inputChannels() list.
It is OK to pass in a mutable set, because this method does not modify the set or retain a reference to it.public static <T> ReturnOrAwait<T> awaitAll(int count)
public static <T> ReturnOrAwait<T> awaitAny(it.unimi.dsi.fastutil.ints.IntSet await)
FrameProcessor.inputChannels() list.
It is OK to pass in a mutable set, because this method does not modify the set or retain a reference to it.public static <T> ReturnOrAwait<T> returnObject(T o)
@Nullable public T value()
isReturn() is true.public it.unimi.dsi.fastutil.ints.IntSet awaitSet()
isAwait() is true.
Numbers in this set correspond to positions in the FrameProcessor.inputChannels() list.public boolean isReturn()
isAwait().public boolean isAwait()
isReturn().public boolean isAwaitAll()
awaitSet() (true), or any channel (false)Copyright © 2011–2022 The Apache Software Foundation. All rights reserved.