-
Notifications
You must be signed in to change notification settings - Fork 138
Activity pause/unpause #1729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Activity pause/unpause #1729
Conversation
| */ | ||
| export class MockActivityEnvironment extends events.EventEmitter { | ||
| public cancel: (reason?: any) => void = () => undefined; | ||
| public cancel: (reason?: any, details?: any) => void = () => undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would a MockActivityEnvironment user be expected to provide as input for the details argument? The signature says any, and the ActivityCancellationDetails class has a private constructor, so it looks like it is simply impossible for users to provide anything useful here.
One solution would be to have ActivityCancellationDetails be just an interface, rather than a class, but then we'd have to make all properties optional, as adding more fields in the future would be a backward incompatible change.
Can you please look at what we do with this in other SDKs, and try to figure out a proper API for this?
And btw, reason being any also feels wrong.
|
I haven't compared with what we did in other SDKs, but it looks like there was quite a few discussions while you were working on the corresponding Python PR. Are you sure this PR correctly mirrors the final state of your Python one? |
Yes, this mirrors the Python activity pause change |
…on details field in activity context private, make activity cancellation tests less flaky
mjameswh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few moere details before we can merge.
a66d099 to
de50973
Compare
de50973 to
3ee7227
Compare
What was changed
Added support to pause/unpause an activity. Cancellations due to pause are received through the heartbeat mechanism of the activity.
Why?
Part of activity operator work.
Closes Heartbeating activities should be interrupted when the activities are paused. #1665
How was this tested:
Couple integration tests
Any docs updates needed?
Likely