Package org.qiunet.utils.async.future
Interface DPromise<V>
- All Known Implementing Classes:
DCompletePromise
- Author:
- qiunet 2020/3/9 08:01
-
Method Summary
Modifier and TypeMethodDescriptionawait()Waits for this future to be completed.Waits for this future to be completed without interruption.static <V> DPromise<V>create()生成新的Promisestatic <V> DPromise<V>使用指定的future生成.booleantryFailure(Throwable cause) 尝试设置失败 与trySuccess(Object)相斥booleantrySuccess(V result) 尝试设置成功 与tryFailure(Throwable)相斥Methods inherited from interface org.qiunet.utils.async.future.DFuture
await, await, awaitUninterruptibly, awaitUninterruptibly, isSuccess, whenComplete
-
Method Details
-
trySuccess
尝试设置成功 与tryFailure(Throwable)相斥- Parameters:
result-- Returns:
-
tryFailure
尝试设置失败 与trySuccess(Object)相斥- Parameters:
cause-- Returns:
-
await
Description copied from interface:DFutureWaits for this future to be completed.- Specified by:
awaitin interfaceDFuture<V>- Throws:
InterruptedException- if the current thread was interrupted
-
awaitUninterruptibly
Description copied from interface:DFutureWaits for this future to be completed without interruption. This method catches anInterruptedExceptionand discards it silently.- Specified by:
awaitUninterruptiblyin interfaceDFuture<V>
-
create
使用指定的future生成. cancel时候. 会cancel 该future 生成新的Promise- Returns:
-
create
生成新的Promise- Returns:
-