IN - the input data type.OUT - the output data type.public interface IOChannel<IN,OUT> extends Channel.InputChannel<IN>, Channel.OutputChannel<OUT>
close() method
must be called in order to correctly terminate the invocation lifecycle.
Created by davide-maestroni on 09/24/2015.Channel.InputChannel<IN>, Channel.OutputChannel<OUT>| Modifier and Type | Method and Description |
|---|---|
IOChannel<IN,OUT> |
after(long delay,
TimeUnit timeUnit)
Tells the channel to delay the transfer of data of the specified time duration.
Note that an abortion command will be delayed as well. |
IOChannel<IN,OUT> |
after(TimeDuration delay)
Tells the channel to delay the transfer of data of the specified time duration.
Note that an abortion command will be delayed as well. |
IOChannel<IN,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.
|
IOChannel<IN,OUT> |
afterMax(TimeDuration timeout)
Tells the channel to wait at the max the specified time duration for the next result to
be available.
|
IOChannel<IN,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.
|
Channel.InputChannel<IN> |
asInput()
Returns this channel as an input one.
|
Channel.OutputChannel<OUT> |
asOutput()
Returns this channel as an output one.
|
IOChannel<IN,OUT> |
close()
Closes the channel input.
If the channel is already closed, this method has no effect. |
IOChannel<IN,OUT> |
eventuallyAbort()
Tells the channel to abort the invocation execution in case no result is available before
the timeout has elapsed.
|
IOChannel<IN,OUT> |
eventuallyAbort(Throwable reason)
Tells the channel to abort the invocation execution in case no result is available before
the timeout has elapsed.
|
IOChannel<IN,OUT> |
eventuallyExit()
Tells the channel to break execution in case no result is available before the timeout
has elapsed.
|
IOChannel<IN,OUT> |
eventuallyThrow()
Tells the channel to throw an
ExecutionTimeoutException in case no result is available before the timeout has elapsed. |
IOChannel<IN,OUT> |
immediately()
Tells the channel to not wait for results to be available.
|
IOChannel<IN,OUT> |
now()
Tells the channel to not delay the transfer of data.
|
IOChannel<IN,OUT> |
orderByCall()
Tells the channel to sort the passed input data based on the order of the calls to the
pass methods.
|
IOChannel<IN,OUT> |
orderByChance()
Tells the channel to avoid sorting the passed input in any particular order.
|
IOChannel<IN,OUT> |
orderByDelay()
Tells the channel to sort the passed input data based on the specific delay.
Note that only the inputs passed with a 0 delay will be delivered in the same order as they are passed to the channel, while the others will be delivered as soon as the dedicated runner handles the specific execution. |
IOChannel<IN,OUT> |
pass(Channel.OutputChannel<? extends IN> channel)
Passes the data returned by the specified channel to this one.
|
IOChannel<IN,OUT> |
pass(IN... inputs)
Passes the specified input data to this channel.
|
IOChannel<IN,OUT> |
pass(IN input)
Passes the specified input to this channel.
|
IOChannel<IN,OUT> |
pass(Iterable<? extends IN> inputs)
Passes the data returned by the specified iterable to this channel.
|
IOChannel<IN,OUT> |
passTo(OutputConsumer<? super OUT> consumer)
Binds this channel to the specified consumer.
|
IOChannel<IN,OUT> |
skip(int count)
Skips the first
count available results by waiting at the maximum for the set
timeout. |
all, checkComplete, hasNext, isBound, next, next, passTo@NotNull IOChannel<IN,OUT> after(@NotNull TimeDuration delay)
after in interface Channel.InputChannel<IN>delay - the delay.@NotNull IOChannel<IN,OUT> after(long delay, @NotNull TimeUnit timeUnit)
after in interface Channel.InputChannel<IN>delay - the delay value.timeUnit - the delay time unit.@NotNull IOChannel<IN,OUT> now()
now in interface Channel.InputChannel<IN>@NotNull IOChannel<IN,OUT> orderByCall()
orderByCall in interface Channel.InputChannel<IN>Channel.InputChannel.orderByChance(),
Channel.InputChannel.orderByDelay()@NotNull IOChannel<IN,OUT> orderByChance()
orderByChance in interface Channel.InputChannel<IN>Channel.InputChannel.orderByCall(),
Channel.InputChannel.orderByDelay()@NotNull IOChannel<IN,OUT> orderByDelay()
orderByDelay in interface Channel.InputChannel<IN>Channel.InputChannel.orderByCall(),
Channel.InputChannel.orderByChance()@NotNull IOChannel<IN,OUT> pass(@Nullable Channel.OutputChannel<? extends IN> channel)
pass in interface Channel.InputChannel<IN>channel - the output channel.@NotNull IOChannel<IN,OUT> pass(@Nullable Iterable<? extends IN> inputs)
pass in interface Channel.InputChannel<IN>inputs - the iterable returning the input data.@NotNull IOChannel<IN,OUT> pass(@Nullable IN input)
pass in interface Channel.InputChannel<IN>input - the input.@NotNull IOChannel<IN,OUT> pass(@Nullable IN... inputs)
pass in interface Channel.InputChannel<IN>inputs - the input data.@NotNull IOChannel<IN,OUT> afterMax(@NotNull TimeDuration timeout)
afterMax in interface Channel.OutputChannel<OUT>timeout - the maximum timeout.@NotNull IOChannel<IN,OUT> afterMax(long timeout, @NotNull TimeUnit timeUnit)
afterMax in interface Channel.OutputChannel<OUT>timeout - the maximum timeout value.timeUnit - the timeout time unit.@NotNull IOChannel<IN,OUT> allInto(@NotNull Collection<? super OUT> results)
allInto in interface Channel.OutputChannel<OUT>results - the collection to fill.Channel.OutputChannel.afterMax(TimeDuration),
Channel.OutputChannel.afterMax(long, TimeUnit),
Channel.OutputChannel.immediately(),
Channel.OutputChannel.eventuallyAbort(),
Channel.OutputChannel.eventuallyAbort(Throwable),
Channel.OutputChannel.eventuallyExit(),
Channel.OutputChannel.eventuallyThrow()@NotNull IOChannel<IN,OUT> eventuallyAbort()
ExecutionTimeoutException exception will be thrown.eventuallyAbort in interface Channel.OutputChannel<OUT>Channel.OutputChannel.afterMax(TimeDuration),
Channel.OutputChannel.afterMax(long, TimeUnit),
Channel.OutputChannel.immediately(),
Channel.OutputChannel.eventuallyAbort(Throwable),
Channel.OutputChannel.eventuallyExit(),
Channel.OutputChannel.eventuallyThrow()@NotNull IOChannel<IN,OUT> eventuallyAbort(@Nullable Throwable reason)
ExecutionTimeoutException exception will be thrown.eventuallyAbort in interface Channel.OutputChannel<OUT>reason - the throwable object identifying the reason of the invocation abortion.Channel.OutputChannel.afterMax(TimeDuration),
Channel.OutputChannel.afterMax(long, TimeUnit),
Channel.OutputChannel.immediately(),
Channel.OutputChannel.eventuallyAbort(),
Channel.OutputChannel.eventuallyExit(),
Channel.OutputChannel.eventuallyThrow()@NotNull IOChannel<IN,OUT> eventuallyExit()
ExecutionTimeoutException exception will be thrown.eventuallyExit in interface Channel.OutputChannel<OUT>Channel.OutputChannel.afterMax(TimeDuration),
Channel.OutputChannel.afterMax(long, TimeUnit),
Channel.OutputChannel.immediately(),
Channel.OutputChannel.eventuallyAbort(),
Channel.OutputChannel.eventuallyAbort(Throwable),
Channel.OutputChannel.eventuallyThrow()@NotNull IOChannel<IN,OUT> eventuallyThrow()
ExecutionTimeoutException in case no result is available before the timeout has elapsed.
This is the default behavior.eventuallyThrow in interface Channel.OutputChannel<OUT>Channel.OutputChannel.afterMax(TimeDuration),
Channel.OutputChannel.afterMax(long, TimeUnit),
Channel.OutputChannel.immediately(),
Channel.OutputChannel.eventuallyAbort(),
Channel.OutputChannel.eventuallyAbort(Throwable),
Channel.OutputChannel.eventuallyExit()@NotNull IOChannel<IN,OUT> immediately()
immediately in interface Channel.OutputChannel<OUT>@NotNull IOChannel<IN,OUT> passTo(@NotNull OutputConsumer<? super OUT> consumer)
IllegalStateException to be thrown.passTo in interface Channel.OutputChannel<OUT>consumer - the consumer instance.@NotNull IOChannel<IN,OUT> skip(int count)
count available results by waiting at the maximum for the set
timeout.skip in interface Channel.OutputChannel<OUT>Channel.OutputChannel.afterMax(TimeDuration),
Channel.OutputChannel.afterMax(long, TimeUnit),
Channel.OutputChannel.immediately(),
Channel.OutputChannel.eventuallyAbort(),
Channel.OutputChannel.eventuallyAbort(Throwable),
Channel.OutputChannel.eventuallyExit(),
Channel.OutputChannel.eventuallyThrow()@NotNull Channel.InputChannel<IN> asInput()
@NotNull Channel.OutputChannel<OUT> asOutput()