Reputation: 6870
What are some key differences between Local Activities and Side Effect? On the surface both of them appear to be similar where Local Activity is a super set. When should user prefer Side Effect over Local Activity.
Upvotes: 1
Views: 793
Reputation: 6870
SideEffect
doesn't support any error handling. If it fails it essentially blocks the workflow execution (by panicing the decision task). It is also executed in the same goroutine as the workflow code.
LocalActivity
is executed in a separate goroutine and supports error handling including automatic retries through RetryOptions
.
So use SideEffect
only for very short lived operations that are not expected to fail. Or if they fail it is OK to block the workflow execution. UUID generation is a good example of such operation.
Upvotes: 2