Skip to content

Commit

Permalink
Addressed Ankit's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jorge-beauregard committed Oct 7, 2020
1 parent f18bf71 commit 396c715
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,7 @@ Mono<Response<Void>> purchaseSearchWithResponse(String searchId, Context context
* until it gets a result from the server
* @return A {@link PollerFlux} object with the search result
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PollerFlux<PhoneNumberSearch, PhoneNumberSearch> beginCreateSearch(
CreateSearchOptions options, Duration pollInterval) {
Objects.requireNonNull(options, "'options' cannot be null.");
Expand All @@ -786,8 +787,8 @@ public PollerFlux<PhoneNumberSearch, PhoneNumberSearch> beginCreateSearch(
createSearchFetchResultOperation());
}

private Function<PollingContext<PhoneNumberSearch>,
Mono<PhoneNumberSearch>> createSearchActivationOperation(CreateSearchOptions options) {
private Function<PollingContext<PhoneNumberSearch>, Mono<PhoneNumberSearch>>
createSearchActivationOperation(CreateSearchOptions options) {
return (pollingContext) -> {
Mono<PhoneNumberSearch> response = createSearch(options).flatMap(createSearchResponse -> {
String searchId = createSearchResponse.getSearchId();
Expand Down Expand Up @@ -829,8 +830,8 @@ Mono<PollResponse<PhoneNumberSearch>>> createSearchPollOperation() {
}

private BiFunction<PollingContext<PhoneNumberSearch>,
PollResponse<PhoneNumberSearch>,
Mono<PhoneNumberSearch>> cancelSearchOperation() {
PollResponse<PhoneNumberSearch>,Mono<PhoneNumberSearch>>
cancelSearchOperation() {
return (pollingContext, firstResponse) -> {
cancelSearch(pollingContext.getActivationResponse().getValue().getSearchId());
return Mono.just(new PhoneNumberSearch());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,13 +530,13 @@ public Response<Void> purchaseSearchWithResponse(String searchId, Context contex
* This function returns a Long Running Operation poller.
*
* @param options A {@link CreateSearchOptions} with the search options
* @param lroDuration The time our long running operation will keep on polling
* @param pollInterval The time our long running operation will keep on polling
* until it gets a result from the server
* @return A {@link SyncPoller} object with the search result
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SyncPoller<PhoneNumberSearch, PhoneNumberSearch> beginCreateSearch(
CreateSearchOptions options, Duration lroDuration) {
return phoneNumberAsyncClient.beginCreateSearch(options, lroDuration).getSyncPoller();
CreateSearchOptions options, Duration pollInterval) {
return phoneNumberAsyncClient.beginCreateSearch(options, pollInterval).getSyncPoller();
}
}

0 comments on commit 396c715

Please sign in to comment.