`startUpdate` JavaDoc says "asynchronously" when it may not be
Expected Behavior
The JavaDoc for startUpdate should indicate that when it's called with a waitForStage of WorkflowUpdateStage.COMPLETED, it's synchronous and blocks until the update is completed.
Actual Behavior
The JavaDoc for startUpdate says the following:
Start a zero argument update workflow request asynchronously.
However, the following code will block until the update is completed:
val updateOptions =
UpdateOptions.newBuilder<UpdateResult>()
.setResultClass(UpdateResult::class.java)
.setWaitForStage(WorkflowUpdateStage.COMPLETED)
.setUpdateId(updateId)
.build()
val update = WorkflowClient.startUpdate(stub::doUpdate, updateOptions) // <-- blocks here
val result = update.getResult(5, TimeUnit.SECONDS)
The JavaDoc implies that startUpdate would ignore the waitForStage, always be asynchronous, and block on the update.getResult.
Steps to Reproduce the Problem
- Look at JavaDoc for
startUpdate - Assume
startUpdateis always asynchronous - Call
startUpdatewith awaitForStageofWorkflowUpdateStage.COMPLETED - See that the
startUpdatecall was actually synchronous
Specifications
- Version: latest master
- Platform: n/a
Requesting that either the word asynchronously is removed from the JavaDoc for the startUpdate methods or it's clear that the function isn't asynchronous in a normal sense.
Thanks!
This is the sort of small change we'd be more than happy to accept a PR for if you're interested!