diff --git a/examples/concurrent_greeter.py b/examples/concurrent_greeter.py index d562d63..a7947b7 100644 --- a/examples/concurrent_greeter.py +++ b/examples/concurrent_greeter.py @@ -55,6 +55,6 @@ async def greet(ctx: Context, req: GreetingRequest) -> Greeting: if isinstance(f, RestateDurableCallFuture): inv = await f.invocation_id() print(f"Canceling {inv}", flush=True) - ctx.cancel(inv) + ctx.cancel_invocation(inv) return Greeting(message=f"Hello {req.name}!") diff --git a/python/restate/context.py b/python/restate/context.py index 5d596c2..36bf30d 100644 --- a/python/restate/context.py +++ b/python/restate/context.py @@ -298,7 +298,7 @@ def reject_awakeable(self, name: str, failure_message: str, failure_code: int = """ @abc.abstractmethod - def cancel(self, invocation_id: str): + def cancel_invocation(self, invocation_id: str): """ Cancels the invocation with the given id. """ diff --git a/python/restate/server_context.py b/python/restate/server_context.py index 0450d3b..6231eaf 100644 --- a/python/restate/server_context.py +++ b/python/restate/server_context.py @@ -610,7 +610,7 @@ def promise(self, name: str, serde: typing.Optional[Serde[T]] = JsonSerde()) -> def key(self) -> str: return self.invocation.key - def cancel(self, invocation_id: str): + def cancel_invocation(self, invocation_id: str): """cancel an existing invocation by id.""" if invocation_id is None: raise ValueError("invocation_id cannot be None") diff --git a/test-services/services/test_utils.py b/test-services/services/test_utils.py index a50e69e..52d3e16 100644 --- a/test-services/services/test_utils.py +++ b/test-services/services/test_utils.py @@ -59,4 +59,4 @@ def effect(): @test_utils.handler(name="cancelInvocation") async def cancel_invocation(context: Context, invocation_id: str) -> None: - context.cancel(invocation_id) + context.cancel_invocation(invocation_id)