You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support the patched(patchId, memoized): boolean and deprecatePatch(patchId, memoized): boolean APIs in all SDKs
Keep backward compatibility on existing APIs in each SDK, but deprecate those APIs
The objective is to encourage users to move to the uniformized, simpler and less confusing APIs.
Documentation on deprecated APIs should clearly indicate how existing calls may safely get converted.
In Core-based SDKs, delegate handling of the patched logic to Core
Some details
The memoized flag needs to be stored in the Marker command, as part of the Workflow history.
Inconsistent usage of the memoized flag should result in a Non-Determinism Error.
Core SDK will implement this first, using the TS SDK as reference for the non-memoized bahavior, and Python/.Net for the memoized behavior. Java and Go will then mirror Core's implementation.
Existing APIs
All SDKs already provide some form of Workflow command to record versioning markers into Workflow history, but those APIs are inconsistent across the board:
Go, Java and PHP have GetVersion, which associates a textual identifier and a numeric value, leaving to the user the responsibility of using these appropriately. GetVersion checks are memoized, meaning that calling GetVersion with a same textual identifier multiple time in the lifetime of a single Workflow Execution will always return the same numeric value as was first returned.
Python, .NET and Ruby have the patched() and deprecate_patch() functions, which only takes a textual identifier, and return boolean value indicating either the new code should be executed or not. The return value is memoized.
TypeScript also have patched() and deprecatePatch() functions, but those are non-memoized.
Describe the solution you'd like
In short
Support the
patched(patchId, memoized): boolean
anddeprecatePatch(patchId, memoized): boolean
APIs in all SDKsKeep backward compatibility on existing APIs in each SDK, but deprecate those APIs
In Core-based SDKs, delegate handling of the
patched
logic to CoreSome details
The
memoized
flag needs to be stored in the Marker command, as part of the Workflow history.Inconsistent usage of the
memoized
flag should result in a Non-Determinism Error.Core SDK will implement this first, using the TS SDK as reference for the non-memoized bahavior, and Python/.Net for the memoized behavior. Java and Go will then mirror Core's implementation.
Existing APIs
All SDKs already provide some form of Workflow command to record versioning markers into Workflow history, but those APIs are inconsistent across the board:
Go, Java and PHP have
GetVersion
, which associates a textual identifier and a numeric value, leaving to the user the responsibility of using these appropriately.GetVersion
checks are memoized, meaning that callingGetVersion
with a same textual identifier multiple time in the lifetime of a single Workflow Execution will always return the same numeric value as was first returned.Python, .NET and Ruby have the
patched()
anddeprecate_patch()
functions, which only takes a textual identifier, and return boolean value indicating either the new code should be executed or not. The return value is memoized.TypeScript also have
patched()
anddeprecatePatch()
functions, but those are non-memoized.Per-SDK Tickets
Patched()
andDeprecatePatch()
APIs sdk-go#1796patched()
anddeprecatePatch()
APIs sdk-java#2393patched()
logic to Core rather than langs sdk-core#869patched()
API sdk-typescript#1616patched()
API sdk-python#754Patched()
API sdk-dotnet#398patched()
API sdk-ruby#209Patched()
andDeprecatePatch()
APIs sdk-php#558The text was updated successfully, but these errors were encountered: