Module org.refcodes.io
Package org.refcodes.io
Interface IoResultAccessor<RES,EXC extends Exception>
-
- Type Parameters:
RES
- The type of the result to be used.EXC
- The exception thrown in case no result is available. UseRuntimeException
to prevent forcing a try/catch block.
- All Superinterfaces:
org.refcodes.mixin.ResultAccessor<RES,EXC>
public interface IoResultAccessor<RES,EXC extends Exception> extends org.refcodes.mixin.ResultAccessor<RES,EXC>
Extends theResultAccessor
interface with an I/O timeout mechanism.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.refcodes.mixin.ResultAccessor
org.refcodes.mixin.ResultAccessor.ResultBuilder<RES extends Object,B extends org.refcodes.mixin.ResultAccessor.ResultBuilder<RES,B>>, org.refcodes.mixin.ResultAccessor.ResultMutator<RES extends Object>, org.refcodes.mixin.ResultAccessor.ResultProperty<RES extends Object,EXC extends Exception>
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default void
waitForResult(long aTimeoutInMs)
Waits for the result.
-
-
-
Method Detail
-
waitForResult
default void waitForResult(long aTimeoutInMs) throws InterruptedException, org.refcodes.exception.TimeoutIoException
Waits for the result. This method blocks till a result is available, the timeout has run out or an exception has been thrown in case there is none such result. UseResultAccessor.hasResult()
to test beforehand whether we already have a result.- Parameters:
aTimeoutInMs
- The timeout to wait for a result- Throws:
InterruptedException
- the interrupted exceptionorg.refcodes.exception.TimeoutIoException
- thrown in ca
-
-