microsoft / microsoft/durabletask-java

Non-blocking Activity task implementations

Open
#2 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P3
Dominant language
Java
Stars
29
Forks
18
Avg merge
1d 10h
Merged PRs (30d)
2

Description

Issue

The TaskActivity interface is currently has a synchronous run method that returns that output of that activity:

public interface TaskActivity {
    Object run(TaskActivityContext ctx);
}

There's currently no way to define a non-blocking, asynchronous activity implementation. This can result in issues related to the scalability of applications if many activity tasks need to be executed concurrently.

Proposal

There should be an alternative mechanism for implementing non-blocking, asynchronous activity tasks. For example:

public interface AsyncTaskActivity {
    CompletionStage<Object> run(TaskActivityContext ctx);
}

The activity will finish when the CompletionStage is completed.

Other considerations

It should be noted that Azure Functions for Java doesn't yet support non-blocking functions: https://github.com/Azure/azure-functions-java-worker/issues/244. Support for non-blocking activity tasks likely won't benefit Azure Functions users until the Java worker for Azure Functions adds async function support. Unfortunately, there's no indication about if or when this support will be added.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the TaskActivity interface and trace how its synchronous run result is consumed. Review the proposed AsyncTaskActivity contract and the linked Azure Functions limitation before defining the implementation scope. Done means an agreed approach for non-blocking activity completion and its integration with the existing activity execution flow.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.