if (options.getTag() != null) {
leaseRequest.setTagAsBytes(options.getTag());
}
}
ApiConfig apiConfig = new ApiConfig();
if (options.getDeadlineInSeconds() == null) {
apiConfig.setDeadlineInSeconds(DEFAULT_LEASE_TASKS_DEADLINE_SECONDS);
} else {
apiConfig.setDeadlineInSeconds(options.getDeadlineInSeconds());
}
Future<TaskQueueQueryAndOwnTasksResponse> responseFuture = apiHelper.makeAsyncCall(
"QueryAndOwnTasks", leaseRequest, new TaskQueueQueryAndOwnTasksResponse(), apiConfig);
return new FutureAdapter<TaskQueueQueryAndOwnTasksResponse, List<TaskHandle>>(responseFuture) {