Skip to content

Commit

Permalink
Fix incorrect signatures of late-registered handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
dandavison committed Aug 20, 2024
1 parent 97688cc commit 191d015
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions tests/worker/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -5426,26 +5426,22 @@ async def run(
if handler_registration == "-late-registered-":
if handler_dynamism == "-dynamic-":

async def my_late_registered_dynamic_update(
self, name: str, args: Sequence[RawValue]
) -> str:
async def my_late_registered_dynamic_update(*args, **kwargs) -> str:
await workflow.wait_condition(lambda: self.handlers_may_finish)
return "my-late-registered-dynamic-update-result"

async def my_late_registered_dynamic_signal(
self, name: str, args: Sequence[RawValue]
) -> None:
async def my_late_registered_dynamic_signal(*args, **kwargs) -> None:
await workflow.wait_condition(lambda: self.handlers_may_finish)

workflow.set_dynamic_update_handler(my_late_registered_dynamic_update)
workflow.set_dynamic_signal_handler(my_late_registered_dynamic_signal)
else:

async def my_late_registered_update(self) -> str:
async def my_late_registered_update() -> str:
await workflow.wait_condition(lambda: self.handlers_may_finish)
return "my-late-registered-update-result"

async def my_late_registered_signal(self) -> None:
async def my_late_registered_signal() -> None:
await workflow.wait_condition(lambda: self.handlers_may_finish)

workflow.set_update_handler(
Expand Down

0 comments on commit 191d015

Please sign in to comment.