Open bergundy opened 2 years ago
Related:
We should give
Workflow.isContinueAsNewNeeded
flag to the SDKs. And it should be coming from the service.
I think we should expose shouldContinueAsNew
as well in all SDKs.
if (workflowInfo().shouldContinueAsNew) {
cAN()
}
is shorter & easier to read/understand compared to:
if (workflowInfo().historyLength < 10_000 && workflowInfo().historySize < 10_000_000) {
cAN()
}
I think we should expose
shouldContinueAsNew
as well in all SDKs.
Concur, when available in server (no benefit in supporting before server). Or is it already available in server? What is the logic there and is it configurable?
It will be important to mention in documentation the fact that relying on these properties is useless and dangerous if using an older server.
We could make it a capability and error (i.e. wft failure) if invoked for older server. But I think this is a good enough reason to not even expose this until it is available on cloud.
Note, we should call this "continue as new suggested" across all SDKs I think.
A caveat that SDKs need to note here: these three values may be delayed if viewed via query. Since the value is on wft start, a query-only poll response won't have updated history. So if you, say, sent a signal to start far-out 50 timers, and then, even after already in history stored, sent just a query, there is no new wft and therefore no value updates even though current event count is actually quite different on the server.
Basically every SDK needs to document that these values may be delayed if accessed in a query.
History length:
History size and "should continue as new":