-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
Add a way for users to obtain an update requests UpdateID in a handler.
Describe the solution you'd like
In Go I would implement it through Info call like GetUpdateInfo
func Counter(ctx workflow.Context) (int, error) {
log := workflow.GetLogger(ctx)
counter := 0
if err := workflow.SetUpdateHandlerWithOptions(
ctx,
FetchAndAdd,
func(ctx workflow.Context, i int) (int, error) {
updateID := workflow.GetUpdateInfo(ctx).UpdateID
tmp := counter
counter += i
log.Info("counter updated", "addend", i, "new-value", counter, "update ID", updateID)
return tmp, nil
},
workflow.UpdateHandlerOptions{Validator: nonNegative},
); err != nil {
return 0, err
}
Additional context
We should also consider adding UpdateID to the interceptors as well
- Go
- Java
- TypeScript - [Feature Request] Expose
updateIdto Update handlers sdk-typescript#1317 - Python
- .NET
- Php
- Ruby
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request