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

Allow users to implement update asynchronously in Java natively #2056

Open
Quinn-With-Two-Ns opened this issue May 8, 2024 · 1 comment
Open
Labels
enhancement User experience

Comments

@Quinn-With-Two-Ns
Copy link
Contributor

Quinn-With-Two-Ns commented May 8, 2024

Is your feature request related to a problem? Please describe.
Currently update handlers in Java are all run in their own threads. This means that if the update handler takes a long time and multiple updates are sent the workflow execution can consume lots of threads just waiting in update handlers.

Describe the solution you'd like
Support the ability to transform an update call into a Promise that can be completed later in another thread like the main workflow method .

Additional context
We have a similar feature to support async activities https://javadoc.io/doc/io.temporal/temporal-sdk/1.0.6/io/temporal/activity/ActivityExecutionContext.html#isUseLocalManualCompletion--

Currently users can do this with the existing SDK API, but it will still consume a thread waiting for the result to return in the handle. If the SDK had a native API for this we wouldn't need to wait in the thread.

@Quinn-With-Two-Ns Quinn-With-Two-Ns added the enhancement User experience label May 8, 2024
@mfateev
Copy link
Member

mfateev commented May 8, 2024

Ideally, the same API can be reused to complete the workflow asynchronously. This would allow workflows to be implemented fully async without tying up a thread when a workflow is cached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement User experience
Projects
None yet
Development

No branches or pull requests

2 participants