temporalio / temporalio/sdk-java
Support a promise-based await
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 433
- Forks
- 249
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 26
Description
An SDK function that works similarly to await but is based on promises rather than blocking could be useful to expand developer options for coordinating mixed event classes. For instance, coordinating an .all() on an invoked activity and receiving a signal.
This interface could be designed in several different ways. As an example:
Promise until(java.time.Duration timeout, java.util.function.Supplier<java.lang.Boolean> predicate)
This function would take a timeout and predicate, and return a promise. Temporal will evaluate the predicate on each state transition (similar to .await), and will resolve the promise with "true" if the predicate returns true. and "false" if the timeout expires.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the existing Workflow.await API with Promise and the proposed Promise<java.lang.Boolean> interface using java.time.Duration and java.util.function.Supplier<java.lang.Boolean>. Clarify the intended API design and state-transition behavior, including coordination with activity promises and signals. Done means the chosen interface resolves true when the predicate becomes true and false when the timeout expires.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design, distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100