cadence-java-client
cadence-java-client copied to clipboard
Activity heartbeat should not require Activity thread to run
Currently Activity heartbeat can only be called from Activity thread. This is quite inconvenient if people want to spawn timers and offload the heartbeat logic to the timer thread, etc.
Since heartbeat is asynchronous anyways, it does make sense to relax this requirement. So that heartbeat can be called from any thread. The caveat is that caller needs to specify other information like domainID, workflowID and activityID etc as we will not be able to get it from the thread context.
It is already supported: https://github.com/mfateev/uber-java-cadence-samples/blob/master/src/main/java/com/uber/cadence/samples/hello/HelloAsyncActivityCompletion.java