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
Azure Functions support #16
Conversation
- Renamed OrchestratorYieldEvent - Added support for "default" orchestrators
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.PARAMETER) | ||
@CustomBinding(direction = "in", name = "", type = "activityTrigger") | ||
public @interface DurableActivityTrigger { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This annotation may need to add a another method such as has_implicit_output (if we following python pattern, depending on the way we implement the java worker to support return value in detail. )
same apply to trigger orchestrationTrigger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm cool with that design. 👍🏽
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Also @cgillum , I found a library (https://github.com/ReactiveX/RxJava) that is widely used to support asynchronous and event-based programs by using observable sequences. It seems much stronger and more flexible than the Completablefuture in java. Maybe in future, we can try to utilize it to strengthen our durable java functions. |
Agreed we should look at potentially supporting RxJava. It's a 3rd party library, so we may want to consider making it an optional layer that sits on top of this core programming model, but it seems like a promising (no pun intended) idea given how popular it is. Thanks for this suggestion! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't comment on the .gradle
files and other declarative-config changes, but this looks good to me as a non-java expert. I left some questions below though
if (factory == null) { | ||
// Try getting the default orchestrator | ||
factory = TaskOrchestrationExecutor.this.orchestrationFactories.get("*"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify when we expect to take this path / when the factory would be null
? Shouldn't we be error'ing out in this path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will always take this path for Functions since there is no ability for an app to register orchestrators by name. In the case of non-Functions, it depends on whether the app code decides to register a default (*) orchestrator function or not. In those cases, this is a way for users to handle the "orchestrator not found" in their own way instead of just getting an error.
This PR adds the following:
OrchestratorYieldEvent
toOrchestratorBlockedEvent
, which feels like a more accurate nameNote that in order for the Azure Functions integration to work, two additional things are needed outside of this PR:
In a later PR, I plan to add a simple sample function. Once the above dependencies are available, we can also create a CI workflow that runs the Functions sample end-to-end.