Class AsyncResponse<T>
java.lang.Object
dev.langchain4j.agentic.internal.AsyncResponse<T>
- All Implemented Interfaces:
DelayedResponse<T>
-
Field Summary
Fields inherited from interface DelayedResponse
FAILED, PENDING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanisDone()booleanisFailed()voidonComplete(Consumer<AsyncResponse<T>> onComplete) Passes this response toonCompletewhen it completes, successfully or not, on the thread completing it, or immediately on the calling thread when it already completed.booleanReturnstrueonly the first time it is called on a response that failed, so that a failure is reported once, also when the response stays in a scope where several root calls end.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface DelayedResponse
result
-
Constructor Details
-
AsyncResponse
-
-
Method Details
-
onComplete
Passes this response toonCompletewhen it completes, successfully or not, on the thread completing it, or immediately on the calling thread when it already completed. -
isDone
public boolean isDone()- Specified by:
isDonein interfaceDelayedResponse<T>
-
isFailed
public boolean isFailed() -
reportFailureOnce
public boolean reportFailureOnce()Returnstrueonly the first time it is called on a response that failed, so that a failure is reported once, also when the response stays in a scope where several root calls end. -
blockingGet
- Specified by:
blockingGetin interfaceDelayedResponse<T>
-
toString
-