restatedev / restatedev/sdk-java
support annotation-based approach
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 60
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Description
I don't like passing all the app logic as lambdas because it makes the codebase messy. It would be great if Restate used an annotation-based approach instead (or something else), which would mean moving the responsibility from the caller method to the called method
What if we created a @Run annotation instead of calling ctx.run()? For example:
@Workflow
public boolean run(WorkflowContext ctx, Email email) {
String secret = ctx.random().nextUUID().toString();
ctx.set(STATUS, "Generated secret");
// ctx.run("send email", () -> sendEmailWithLink(email, secret));
sendEmailWithLink(email, secret);
ctx.set(STATUS, "Sent email");
String clickSecret =
ctx.promise(EMAIL_CLICKED)
.future()
.await();
ctx.set(STATUS, "Clicked email");
return clickSecret.equals(secret);
}
@Run("send email")
public void sendEmailWithLink(Email email, String secret) {
// ......
}
That's not only for ctx.run(), it can be applied to a lot of methods.
Contributor guide
No contributing guide indexed for this repository
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 reviewing the current ctx.run() usage and the @Workflow example in the issue, then compare how moving responsibility to a called method would affect other context methods. Define the annotation semantics, supported method boundaries, and compatibility expectations before implementation; done means the approach is specified and its feasibility is resolved.
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
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100