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

Open
slinkydeveloper opened this issue Jul 3, 2024 · 2 comments
Open

cancel from Context API #1687

slinkydeveloper opened this issue Jul 3, 2024 · 2 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
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

2 participants