@@ -5837,8 +5837,14 @@ public CompletableFuture<UpdateApiKeyResponse> updateApiKeyAsync(@Nonnull String
5837
5837
* @param requestOptions The requestOptions to send along with the query, they will be merged with
5838
5838
* the transporter requestOptions. (optional)
5839
5839
*/
5840
- public void waitForTask (String indexName , Long taskID , int maxRetries , IntUnaryOperator timeout , RequestOptions requestOptions ) {
5841
- TaskUtils .retryUntil (
5840
+ public GetTaskResponse waitForTask (
5841
+ String indexName ,
5842
+ Long taskID ,
5843
+ int maxRetries ,
5844
+ IntUnaryOperator timeout ,
5845
+ RequestOptions requestOptions
5846
+ ) {
5847
+ return TaskUtils .retryUntil (
5842
5848
() -> this .getTask (indexName , taskID , requestOptions ),
5843
5849
(GetTaskResponse task ) -> task .getStatus () == TaskStatus .PUBLISHED ,
5844
5850
maxRetries ,
@@ -5854,8 +5860,8 @@ public void waitForTask(String indexName, Long taskID, int maxRetries, IntUnaryO
5854
5860
* @param requestOptions The requestOptions to send along with the query, they will be merged with
5855
5861
* the transporter requestOptions. (optional)
5856
5862
*/
5857
- public void waitForTask (String indexName , Long taskID , RequestOptions requestOptions ) {
5858
- this .waitForTask (indexName , taskID , TaskUtils .DEFAULT_MAX_RETRIES , TaskUtils .DEFAULT_TIMEOUT , requestOptions );
5863
+ public GetTaskResponse waitForTask (String indexName , Long taskID , RequestOptions requestOptions ) {
5864
+ return this .waitForTask (indexName , taskID , TaskUtils .DEFAULT_MAX_RETRIES , TaskUtils .DEFAULT_TIMEOUT , requestOptions );
5859
5865
}
5860
5866
5861
5867
/**
@@ -5867,8 +5873,8 @@ public void waitForTask(String indexName, Long taskID, RequestOptions requestOpt
5867
5873
* @param timeout The function to decide how long to wait between retries. min(retries * 200,
5868
5874
* 5000) by default. (optional)
5869
5875
*/
5870
- public void waitForTask (String indexName , Long taskID , int maxRetries , IntUnaryOperator timeout ) {
5871
- this .waitForTask (indexName , taskID , maxRetries , timeout , null );
5876
+ public GetTaskResponse waitForTask (String indexName , Long taskID , int maxRetries , IntUnaryOperator timeout ) {
5877
+ return this .waitForTask (indexName , taskID , maxRetries , timeout , null );
5872
5878
}
5873
5879
5874
5880
/**
@@ -5877,8 +5883,8 @@ public void waitForTask(String indexName, Long taskID, int maxRetries, IntUnaryO
5877
5883
* @param indexName The `indexName` where the operation was performed.
5878
5884
* @param taskID The `taskID` returned in the method response.
5879
5885
*/
5880
- public void waitForTask (String indexName , Long taskID ) {
5881
- this .waitForTask (indexName , taskID , TaskUtils .DEFAULT_MAX_RETRIES , TaskUtils .DEFAULT_TIMEOUT , null );
5886
+ public GetTaskResponse waitForTask (String indexName , Long taskID ) {
5887
+ return this .waitForTask (indexName , taskID , TaskUtils .DEFAULT_MAX_RETRIES , TaskUtils .DEFAULT_TIMEOUT , null );
5882
5888
}
5883
5889
5884
5890
/**
@@ -5891,8 +5897,8 @@ public void waitForTask(String indexName, Long taskID) {
5891
5897
* @param requestOptions The requestOptions to send along with the query, they will be merged with
5892
5898
* the transporter requestOptions. (optional)
5893
5899
*/
5894
- public void waitForAppTask (Long taskID , int maxRetries , IntUnaryOperator timeout , RequestOptions requestOptions ) {
5895
- TaskUtils .retryUntil (
5900
+ public GetTaskResponse waitForAppTask (Long taskID , int maxRetries , IntUnaryOperator timeout , RequestOptions requestOptions ) {
5901
+ return TaskUtils .retryUntil (
5896
5902
() -> this .getAppTask (taskID , requestOptions ),
5897
5903
(GetTaskResponse task ) -> task .getStatus () == TaskStatus .PUBLISHED ,
5898
5904
maxRetries ,
@@ -5907,8 +5913,8 @@ public void waitForAppTask(Long taskID, int maxRetries, IntUnaryOperator timeout
5907
5913
* @param requestOptions The requestOptions to send along with the query, they will be merged with
5908
5914
* the transporter requestOptions. (optional)
5909
5915
*/
5910
- public void waitForAppTask (Long taskID , RequestOptions requestOptions ) {
5911
- this .waitForAppTask (taskID , TaskUtils .DEFAULT_MAX_RETRIES , TaskUtils .DEFAULT_TIMEOUT , requestOptions );
5916
+ public GetTaskResponse waitForAppTask (Long taskID , RequestOptions requestOptions ) {
5917
+ return this .waitForAppTask (taskID , TaskUtils .DEFAULT_MAX_RETRIES , TaskUtils .DEFAULT_TIMEOUT , requestOptions );
5912
5918
}
5913
5919
5914
5920
/**
@@ -5919,17 +5925,17 @@ public void waitForAppTask(Long taskID, RequestOptions requestOptions) {
5919
5925
* @param timeout The function to decide how long to wait between retries. min(retries * 200,
5920
5926
* 5000) by default. (optional)
5921
5927
*/
5922
- public void waitForAppTask (Long taskID , int maxRetries , IntUnaryOperator timeout ) {
5923
- this .waitForAppTask (taskID , maxRetries , timeout , null );
5928
+ public GetTaskResponse waitForAppTask (Long taskID , int maxRetries , IntUnaryOperator timeout ) {
5929
+ return this .waitForAppTask (taskID , maxRetries , timeout , null );
5924
5930
}
5925
5931
5926
5932
/**
5927
5933
* Helper: Wait for an application-level task to complete with `taskID`.
5928
5934
*
5929
5935
* @param taskID The `taskID` returned in the method response.
5930
5936
*/
5931
- public void waitForAppTask (Long taskID ) {
5932
- this .waitForAppTask (taskID , TaskUtils .DEFAULT_MAX_RETRIES , TaskUtils .DEFAULT_TIMEOUT , null );
5937
+ public GetTaskResponse waitForAppTask (Long taskID ) {
5938
+ return this .waitForAppTask (taskID , TaskUtils .DEFAULT_MAX_RETRIES , TaskUtils .DEFAULT_TIMEOUT , null );
5933
5939
}
5934
5940
5935
5941
/**
0 commit comments