Skip to content
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

cancel from Context API #1687

Closed
slinkydeveloper opened this issue Jul 3, 2024 · 5 comments
Closed

cancel from Context API #1687

slinkydeveloper opened this issue Jul 3, 2024 · 5 comments
Assignees
Labels
api-devex Restate user facing Development model sdk user-feedback

Comments

@slinkydeveloper
Copy link
Contributor

Expose the ability to do a one way call from the Context, then cancel/kill it from context too.

@slinkydeveloper slinkydeveloper added api-devex Restate user facing Development model user-feedback sdk labels Jul 3, 2024
@nythrox
Copy link

nythrox commented Jul 23, 2024

Temporary workaround: if a workflows' own invocationId is exposed in the context (its already in ContextImpl, just needs to be made public) then workflows can expose a cancel handler which cancels itself using their invocationId and #412. External services can cancel it using the handler (ctx.workflowSendClient(Foo, key).cancel()).

I'm doing this for now by bypassing typescript's fake private fields and just grabbing ctx.stateMachine.invocation.debugId
With a bit of work you can make this work for services too, by making service calls self-register in some virtual object. Wouldn't recommend it.

@slinkydeveloper slinkydeveloper self-assigned this Sep 18, 2024
@slinkydeveloper
Copy link
Contributor Author

Done in Protocol V4

@musjj
Copy link

musjj commented Feb 20, 2025

Is there now a way to do this from the SDK? I can't find it in the Rust SDK, at the very least.

@slinkydeveloper
Copy link
Contributor Author

This is not available in any SDK yet, this was the server part of the feature. In Rust SDK there is an open PR restatedev/sdk-rust#27 but I need to finish this one yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-devex Restate user facing Development model sdk user-feedback
Projects
None yet
Development

No branches or pull requests

3 participants