-
Notifications
You must be signed in to change notification settings - Fork 18
Kitchensink client activity [Python, TS, .NET] #188
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
Conversation
e27315e to
022c30f
Compare
| WorkflowInput: &WorkflowInput{ | ||
| InitialActions: ListActionSet( | ||
| NewTimerAction(2000), // timer to keep workflow open long enough for client action | ||
| NewTimerAction(5000), // timer to keep workflow open long enough for client action |
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.
Trying to mitigate flaky tests. Better solution might be to add AllHandlersFinished but I'm not quite sure how to.
022c30f to
f86c5e2
Compare
Sushisource
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 things worth checking out
| throw new ArgumentException("DoSignal must have a recognizable variant"); | ||
| } | ||
|
|
||
| var args = signalArgs == null ? Array.Empty<object>() : (signalArgs is object[] array ? array : new[] { signalArgs }); |
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.
This line is pretty hard to parse
|
|
||
| try | ||
| { | ||
| var args = updateArgs == null ? Array.Empty<object>() : (updateArgs is object[] array ? array : new[] { updateArgs }); |
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.
Same confusing line (maybe can be extracted?)
|
|
||
| async def _execute_client_action_set(self, action_set: ClientActionSet): | ||
| if action_set.concurrent: | ||
| from temporalio.exceptions import ApplicationError |
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.
Inline imports here (and below) a bit funky. Can just lift them up.
| const handle = this.client.workflow.getHandle(this.workflowId, this.runId); | ||
| try { | ||
| await handle.result(); | ||
| } catch (error) { |
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.
Pretty non-specific catch. Should probably be looking specifically for CAN? Also seems like this isn't a thing in the other langs?
What was changed
Follow-up to #179 to include other SDKs.
Adds new "Client" ActivityType to execute client actions (e.g. Update, Signal) from a workflow activity to TS, .NET and Python.
The client action executor implementations were all modeled after the Go one.
ℹ️ Concurrent execution of the client actions is out of scope for this PR.
🫘 I couldn't get Java to work; it's out of scope for this PR now. Sorry.
Why?
Narrow kitchensink support gap to Go.
Checklist
Closes
How was this tested: