OUT - the output data type.public static interface Channel.OutputChannel<OUT> extends Channel, Iterator<OUT>, Iterable<OUT>
Channel.InputChannel<IN>, Channel.OutputChannel<OUT>| Modifier and Type | Method and Description |
|---|---|
Channel.OutputChannel<OUT> |
afterMax(long timeout,
TimeUnit timeUnit)
Tells the channel to wait at the max the specified time duration for the next result to
be available.
|
Channel.OutputChannel<OUT> |
afterMax(TimeDuration timeout)
Tells the channel to wait at the max the specified time duration for the next result to
be available.
|
List<OUT> |
all()
Consumes all the results by waiting for the routine to complete at the maximum for the
set timeout.
|
Channel.OutputChannel<OUT> |
allInto(Collection<? super OUT> results)
Consumes all the results by waiting for the routine to complete at the maximum for the
set timeout, and put them into the specified collection.
|
boolean |
checkComplete()
Checks if the routine is complete, waiting at the maximum for the set timeout.
|
Channel.OutputChannel<OUT> |
eventuallyAbort()
Tells the channel to abort the invocation execution in case no result is available before
the timeout has elapsed.
|
Channel.OutputChannel<OUT> |
eventuallyAbort(Throwable reason)
Tells the channel to abort the invocation execution in case no result is available before
the timeout has elapsed.
|
Channel.OutputChannel<OUT> |
eventuallyExit()
Tells the channel to break execution in case no result is available before the timeout
has elapsed.
|
Channel.OutputChannel<OUT> |
eventuallyThrow()
Tells the channel to throw an
ExecutionTimeoutException in case no result is available before the timeout has elapsed. |
boolean |
hasNext()
Checks if more results are available by waiting at the maximum for the set timeout.
|
Channel.OutputChannel<OUT> |
immediately()
Tells the channel to not wait for results to be available.
|
boolean |
isBound()
Checks if this channel is bound to a consumer or another channel.
|
OUT |
next()
Consumes the first available result by waiting at the maximum for the set timeout.
|
List<OUT> |
next(int count)
Consumes the first
count available results by waiting at the maximum for the set
timeout. |
<CHANNEL extends Channel.InputChannel<? super OUT>> |
passTo(CHANNEL channel)
Binds this channel to the specified one.
|
Channel.OutputChannel<OUT> |
passTo(OutputConsumer<? super OUT> consumer)
Binds this channel to the specified consumer.
|
Channel.OutputChannel<OUT> |
skip(int count)
Skips the first
count available results by waiting at the maximum for the set
timeout. |
@NotNull Channel.OutputChannel<OUT> afterMax(@NotNull TimeDuration timeout)
timeout - the maximum timeout.@NotNull Channel.OutputChannel<OUT> afterMax(long timeout, @NotNull TimeUnit timeUnit)
timeout - the maximum timeout value.timeUnit - the timeout time unit.IllegalArgumentException - if the specified timeout is negative.@NotNull List<OUT> all()
ExecutionTimeoutException - if the channel is set to
throw an exception when the
timeout elapses.RoutineException - if the execution has been
aborted.IllegalStateException - if this channel is already
bound to a consumer or
another channel.afterMax(TimeDuration),
afterMax(long, TimeUnit),
immediately(),
eventuallyAbort(),
eventuallyAbort(Throwable),
eventuallyExit(),
eventuallyThrow()@NotNull Channel.OutputChannel<OUT> allInto(@NotNull Collection<? super OUT> results)
results - the collection to fill.ExecutionTimeoutException - if the channel is set to
throw an exception when the
timeout elapses.RoutineException - if the execution has been
aborted.IllegalStateException - if this channel is already
bound to a consumer or
another channel.afterMax(TimeDuration),
afterMax(long, TimeUnit),
immediately(),
eventuallyAbort(),
eventuallyAbort(Throwable),
eventuallyExit(),
eventuallyThrow()boolean checkComplete()
afterMax(TimeDuration),
afterMax(long, TimeUnit),
immediately()@NotNull Channel.OutputChannel<OUT> eventuallyAbort()
ExecutionTimeoutException exception will be thrown.afterMax(TimeDuration),
afterMax(long, TimeUnit),
immediately(),
eventuallyAbort(Throwable),
eventuallyExit(),
eventuallyThrow()@NotNull Channel.OutputChannel<OUT> eventuallyAbort(@Nullable Throwable reason)
ExecutionTimeoutException exception will be thrown.reason - the throwable object identifying the reason of the invocation abortion.afterMax(TimeDuration),
afterMax(long, TimeUnit),
immediately(),
eventuallyAbort(),
eventuallyExit(),
eventuallyThrow()@NotNull Channel.OutputChannel<OUT> eventuallyExit()
ExecutionTimeoutException exception will be thrown.afterMax(TimeDuration),
afterMax(long, TimeUnit),
immediately(),
eventuallyAbort(),
eventuallyAbort(Throwable),
eventuallyThrow()@NotNull Channel.OutputChannel<OUT> eventuallyThrow()
ExecutionTimeoutException in case no result is available before the timeout has elapsed.
This is the default behavior.afterMax(TimeDuration),
afterMax(long, TimeUnit),
immediately(),
eventuallyAbort(),
eventuallyAbort(Throwable),
eventuallyExit()boolean hasNext()
hasNext in interface Iterator<OUT>ExecutionTimeoutException - if the channel is set to
throw an exception when the
timeout elapses.RoutineException - if the execution has been
aborted.IllegalStateException - if this channel is already
bound to a consumer or
another channel.afterMax(TimeDuration),
afterMax(long, TimeUnit),
immediately(),
eventuallyAbort(),
eventuallyAbort(Throwable),
eventuallyExit(),
eventuallyThrow()OUT next()
next in interface Iterator<OUT>ExecutionTimeoutException - if the channel is set to
throw an exception when the
timeout elapses.RoutineException - if the execution has been
aborted.IllegalStateException - if this channel is already
bound to a consumer or
another channel.NoSuchElementException - if no output is available (it
might be thrown also in the
case the read timeout elapses
and no timeout exception is
set to be thrown).afterMax(TimeDuration),
afterMax(long, TimeUnit),
immediately(),
eventuallyAbort(),
eventuallyAbort(Throwable),
eventuallyExit(),
eventuallyThrow()@NotNull Channel.OutputChannel<OUT> immediately()
boolean isBound()
passTo(InputChannel),
passTo(OutputConsumer)@NotNull List<OUT> next(int count)
count available results by waiting at the maximum for the set
timeout.ExecutionTimeoutException - if the channel is set to
throw an exception when the
timeout elapses.RoutineException - if the execution has been
aborted.IllegalStateException - if this channel is already
bound to a consumer or
another channel.afterMax(TimeDuration),
afterMax(long, TimeUnit),
immediately(),
eventuallyAbort(),
eventuallyAbort(Throwable),
eventuallyExit(),
eventuallyThrow()@NotNull <CHANNEL extends Channel.InputChannel<? super OUT>> CHANNEL passTo(@NotNull CHANNEL channel)
IllegalStateException to be thrown.CHANNEL - the input channel type.channel - the input channelIllegalStateException - if this channel is already bound.@NotNull Channel.OutputChannel<OUT> passTo(@NotNull OutputConsumer<? super OUT> consumer)
IllegalStateException to be thrown.consumer - the consumer instance.IllegalStateException - if this channel is already bound.@NotNull Channel.OutputChannel<OUT> skip(int count)
count available results by waiting at the maximum for the set
timeout.ExecutionTimeoutException - if the channel is set to
throw an exception when the
timeout elapses.RoutineException - if the execution has been
aborted.IllegalStateException - if this channel is already
bound to a consumer or
another channel.afterMax(TimeDuration),
afterMax(long, TimeUnit),
immediately(),
eventuallyAbort(),
eventuallyAbort(Throwable),
eventuallyExit(),
eventuallyThrow()