Skip to content

Conversation

@summer-ji-eng
Copy link
Contributor

Inside of try body,

  1. construct request with default values.
  2. Assign future variable with invoking LRO callable method.
  3. Assign response variable with invoking future.get method.
   * try (CloudRedisClient cloudRedisClient = CloudRedisClient.create()) {
   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   *   String instanceId = "test_instance";
   *   Instance.Tier tier = Instance.Tier.BASIC;
   *   int memorySizeGb = 1;
   *   Instance instance = Instance.newBuilder()
   *     .setTier(tier)
   *     .setMemorySizeGb(memorySizeGb)
   *     .build();
   *   CreateInstanceRequest request = CreateInstanceRequest.newBuilder()
   *     .setParent(parent.toString())
   *     .setInstanceId(instanceId)
   *     .setInstance(instance)
   *     .build();
   *   OperationFuture<Instance, OperationMetadata> future = cloudRedisClient.createInstanceOperationCallable().futureCall(request);
   *   // Do something
   *   Instance response = future.get();
   * }

@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Dec 15, 2020
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Dec 15, 2020
Base automatically changed from default_unary_samplecode_1 to samplecode-master December 17, 2020 04:49
@summer-ji-eng summer-ji-eng marked this pull request as ready for review December 17, 2020 08:28
Copy link
Contributor

@miraleung miraleung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has master been merged into the base branch recently?

@summer-ji-eng
Copy link
Contributor Author

Has master been merged into the base branch recently?

Thanks for reminding. Yes. The lastest commit from master is #604

@summer-ji-eng summer-ji-eng merged commit b525326 into samplecode-master Dec 21, 2020
@summer-ji-eng summer-ji-eng deleted the lro_callable_method branch December 21, 2020 19:08
suztomo pushed a commit that referenced this pull request Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants