-
Notifications
You must be signed in to change notification settings - Fork 138
initial asyncio implementation after durable task asyncio work #827
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
ext/dapr-ext-workflow/dapr/ext/workflow/workflow_activity_context.py
Outdated
Show resolved
Hide resolved
| These examples mirror `examples/workflow/` but author orchestrators with `async def` using the | ||
| async workflow APIs. Activities remain regular functions unless noted. | ||
|
|
||
| How to run: |
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.
pls add a venv reference in here too
examples/workflow/requirements.txt
Outdated
| # dapr-ext-workflow-dev>=1.15.0.dev | ||
| # dapr-dev>=1.15.0.dev | ||
|
|
||
| # local development: install local packages in editable mode | ||
|
|
||
| # if using dev version of durabletask-python | ||
| -e ../../../durabletask-python | ||
|
|
||
| # if using dev version of dapr-ext-workflow | ||
| -e ../../ext/dapr-ext-workflow | ||
| -e ../.. |
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.
| # dapr-ext-workflow-dev>=1.15.0.dev | |
| # dapr-dev>=1.15.0.dev | |
| # local development: install local packages in editable mode | |
| # if using dev version of durabletask-python | |
| -e ../../../durabletask-python | |
| # if using dev version of dapr-ext-workflow | |
| -e ../../ext/dapr-ext-workflow | |
| -e ../.. | |
| dapr-ext-workflow-dev>=1.15.0.dev | |
| dapr-dev>=1.15.0.dev | |
| # local development: install local packages in editable mode | |
| # if using dev version of durabletask-python | |
| # -e ../../../durabletask-python | |
| # if using dev version of dapr-ext-workflow | |
| # -e ../../ext/dapr-ext-workflow | |
| # -e ../.. |
ext/dapr-ext-workflow/Dapr-Workflow-Middleware-Outbound-Hooks.md
Outdated
Show resolved
Hide resolved
ext/dapr-ext-workflow/Dapr-Workflow-Middleware-Outbound-Hooks.md
Outdated
Show resolved
Hide resolved
ext/dapr-ext-workflow/Dapr-Workflow-Middleware-Outbound-Hooks.md
Outdated
Show resolved
Hide resolved
ext/dapr-ext-workflow/Dapr-Workflow-Middleware-Outbound-Hooks.md
Outdated
Show resolved
Hide resolved
ext/dapr-ext-workflow/Dapr-Workflow-Middleware-Outbound-Hooks.md
Outdated
Show resolved
Hide resolved
ext/dapr-ext-workflow/Dapr-Workflow-Middleware-Outbound-Hooks.md
Outdated
Show resolved
Hide resolved
ext/dapr-ext-workflow/Dapr-Workflow-Middleware-Outbound-Hooks.md
Outdated
Show resolved
Hide resolved
ext/dapr-ext-workflow/Dapr-Workflow-Middleware-Outbound-Hooks.md
Outdated
Show resolved
Hide resolved
ext/dapr-ext-workflow/Dapr-Workflow-Middleware-Outbound-Hooks.md
Outdated
Show resolved
Hide resolved
d42eb41 to
469c2e4
Compare
Signed-off-by: Filinto Duran <1373693+filintod@users.noreply.github.com>
469c2e4 to
12269e7
Compare
Signed-off-by: Filinto Duran <1373693+filintod@users.noreply.github.com>
Signed-off-by: Filinto Duran <1373693+filintod@users.noreply.github.com>
Signed-off-by: Filinto Duran <1373693+filintod@users.noreply.github.com>
Signed-off-by: Filinto Duran <1373693+filintod@users.noreply.github.com>
| def hello_act(ctx: WorkflowActivityContext, wf_input): | ||
| global counter | ||
| counter += wf_input | ||
| return f'Activity returned {wf_input}' |
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.
@filintod It'd be very useful to be able to define async activities like so:
@wfr.async_activity(name='async_hello_act')
async def hello_act(ctx: WorkflowActivityContext, wf_input):
result = await some_async_func(wf_input)
return resultWould it make sense to include support for that in this PR?
| print(f'Child workflow returned {result_4}') | ||
|
|
||
| # Event vs timeout using when_any | ||
| event_1 = ctx.wait_for_external_event(event_name) |
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.
shouldn't these become async as well?
|
@filintod looking at the examples you've added I think you would benefit from either waiting for my PR to be merged or merging that PR into your branch. |
Signed-off-by: Filinto Duran <1373693+filintod@users.noreply.github.com>
Description
Make it possible to use python workflow that manages code using asyncio to retrofit code that is already written as async/await.
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #[issue number]
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: