Package com.openai.core
Class AutoPagerAsync
-
- All Implemented Interfaces:
-
com.openai.core.http.AsyncStreamResponse
public final class AutoPagerAsync<T extends Object> implements AsyncStreamResponse<T>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
AutoPagerAsync.Companion
-
Field Summary
Fields Modifier and Type Field Description public final static AutoPagerAsync.Companion
Companion
-
Method Summary
Modifier and Type Method Description AsyncStreamResponse<T>
subscribe(AsyncStreamResponse.Handler<T> handler)
Registers handler to be called for events of this stream. AsyncStreamResponse<T>
subscribe(AsyncStreamResponse.Handler<T> handler, Executor executor)
Registers handler to be called for events of this stream. CompletableFuture<Void>
onCompleteFuture()
Returns a future that completes when a stream is fully consumed, errors, or gets closed early. Unit
close()
Closes this resource, relinquishing any underlying resources. -
-
Method Detail
-
subscribe
AsyncStreamResponse<T> subscribe(AsyncStreamResponse.Handler<T> handler)
Registers handler to be called for events of this stream.
handler's methods will be called in the client's configured or default thread pool.
-
subscribe
AsyncStreamResponse<T> subscribe(AsyncStreamResponse.Handler<T> handler, Executor executor)
Registers handler to be called for events of this stream.
-
onCompleteFuture
CompletableFuture<Void> onCompleteFuture()
Returns a future that completes when a stream is fully consumed, errors, or gets closed early.
-
close
Unit close()
Closes this resource, relinquishing any underlying resources.
This is purposefully not inherited from AutoCloseable because this response should not be synchronously closed via try-with-resources.
-
-
-
-