Skip to content

Conversation

natemort
Copy link
Member

Create a basic activity executor capable of running functions as activities. Async functions are run as part of the main event loop, while sync ones are run in a threaadpool executor.

Type hints are expected for any parameters the activity takes, with non-typed parameters receiving the deserialized json value as a standard python type (dict, list, string, etc.).

Plenty of work remains for full activity support, such as maintaining an activity context for heartbeating.

What changed?

  • Added basic support for an activity executor

Why?

  • To continue work on an activity worker

How did you test it?

  • Unit tests

Potential risks

Release notes

Documentation Changes

@@ -29,7 +29,7 @@ async def poll(_, timeout=0.0):
type(client).domain = PropertyMock(return_value="domain")
type(client).identity = PropertyMock(return_value="identity")

worker = Worker(client, "task_list", activity_task_pollers=1, decision_task_pollers=1, identity="identity")
worker = Worker(client, "task_list", Registry(), activity_task_pollers=1, decision_task_pollers=1, identity="identity")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should we do some assertion on the field?

Copy link
Member

@timl3136 timl3136 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Create a basic activity executor capable of running functions as activities. Async functions are run as part of the main event loop, while sync ones are run in a threaadpool executor.

Type hints are expected for any parameters the activity takes, with non-typed parameters receiving the deserialized json value as a standard python type (dict, list, string, etc.).

Plenty of work remains for full activity support, such as maintaining an activity context for heartbeating.
@natemort natemort merged commit 1213216 into cadence-workflow:main Sep 2, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants