-
Notifications
You must be signed in to change notification settings - Fork 138
Added async workflow client implementation, leveraging new durabletask.aio.client implementation #861
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
base: main
Are you sure you want to change the base?
Conversation
…k.aio.client implementation Signed-off-by: Patrick Assuied <[email protected]>
d32c9aa to
d17b262
Compare
Signed-off-by: Patrick Assuied <[email protected]>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #861 +/- ##
==========================================
+ Coverage 86.63% 87.49% +0.86%
==========================================
Files 84 98 +14
Lines 4473 6484 +2011
==========================================
+ Hits 3875 5673 +1798
- Misses 598 811 +213 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@passuied I think this other PR covers this same thing, and is a bit more complete because it also have async context, but it's WIP as it has lots of lint changes that are now applied to |
|
@acroca actually this is a bit different, as this tackles the client initiating actions against a workflow(schedule workflow, signal events), instead of the internals of the workflow that my PR tackles. He did the PR in durabletask that complements this dapr/durabletask-python#17. The PRs his/mine are complementary and not overlapping |
acroca
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.
Looks good, but I'd follow the same pattern as the DaprClient and not have a suffix Async for the async version.
ext/dapr-ext-workflow/dapr/ext/workflow/aio/dapr_workflow_client.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Patrick Assuied <[email protected]>
|
@passuied Can you add an example to |
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.
LGTM, but tests are failing, and copyright headers need to be fixed :)
ext/dapr-ext-workflow/dapr/ext/workflow/aio/workflow_runtime.py
Outdated
Show resolved
Hide resolved
ext/dapr-ext-workflow/dapr/ext/workflow/aio/workflow_runtime.py
Outdated
Show resolved
Hide resolved
ext/dapr-ext-workflow/dapr/ext/workflow/aio/dapr_workflow_client.py
Outdated
Show resolved
Hide resolved
| ] | ||
|
|
||
|
|
||
| class WorkflowRuntime(WorkflowRuntimeSync): |
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.
I'm not sure if wrapping the sync runtime is the best course of action here. Instead, it should be natively supported by durabletask it looks like there's been a lot of work, including async support done there. Are you sure it's not already a resolved problem?
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.
@akotsarelation I agree that when I look at @filintod's PR, I'm inclined to wait for his work to be complete so we can replace the whole WorkflowRuntime with his full async implementation...
It wasn't so apparent until I worked on the example @acroca and I had to override WorkflowRuntime (but not in an ideal way as I still need the work from that PR)... While the current solution works it does mix sync and async and comes with performance downsides... If this PR is coming soon, I'm inclined to not publish this one and instead wait for the full blown solution....
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.
I guess the issue is that you were changing not only the client side (dapr_workflow_client) but also the workflowruntime, that yeah you would need something like what I am doing. Was that needed here? as your durabletask PR only dealt with the client side (schedule workflow, etc) and why I said this PR and the durabletask were complementary but not if mixing workflow runtime too.
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.
I think that if you remove the workflow_runtime and the test_workflow_runtime files, then this PR would be fine. I was under the impression you wanted asyncio support for the client actions (schedule workflow, wait for workflow, raise events, etc). Try in your example to use the regular sync WorkflowRuntime, but use your asyncio awaitable client methods to start the workflow and raise the events via await
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.
Yes I only added it because I needed to provide an example and without a 'compatible' runtime, it didn't make sense at all...
If @acroca is ok I can revert workflowruntime, and example and we can bring back the example once we have all the pieces in place?
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.
As long as everything in the PR is tested, I'm happy :P If I understand correctly, you'll remove the test_workflow_runtime but will keep the other right?
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.
75f3e7c to
6b8d7c8
Compare
Signed-off-by: Patrick Assuied <[email protected]>
Signed-off-by: Patrick Assuied <[email protected]>
Description
Added async workflow client implementation, leveraging new durabletask.aio.client implementation
Issue reference
#834
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: