-
Notifications
You must be signed in to change notification settings - Fork 6
feat: enable HTTP function trigger async functions #10
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
Conversation
Signed-off-by: Haili Zhang <[email protected]>
Signed-off-by: Haili Zhang <[email protected]>
Signed-off-by: Haili Zhang <[email protected]>
Signed-off-by: Haili Zhang <[email protected]>
f875712
to
63b7b79
Compare
@benjaminhuo please help check whether the |
Signed-off-by: Haili Zhang <[email protected]>
Signed-off-by: Haili Zhang <[email protected]>
Signed-off-by: Haili Zhang <[email protected]>
@benjaminhuo please help review latest updates, many thanks. |
ctx.setTrigger(req, res); | ||
|
||
Promise.resolve() | ||
.then(() => userFunction(ctx, req.body)) |
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.
Sorry for my late response, basically the new signature refactoring looks good.
One more thing, I think go ff's handling of function output and return error is more reasonable.
What if send fails? Here're more refs:
- automatically set http ret code based on function error code https://github.com/OpenFunction/functions-framework-go/blob/main/runtime/knative/knative.go#L66
- encapsule function output into context: https://github.com/OpenFunction/functions-framework-go/blob/f1e311b3bf253b00c3cf494826f57acd22224016/runtime/runtime.go#L134
- return error in function when send fails or other errors occur : https://github.com/OpenFunction/samples/blob/main/functions/knative/with-output-binding/sender.go#L23
Resolves #6