feat: enable HTTP function trigger async functions#10
Merged
Conversation
Signed-off-by: Haili Zhang <haili.zhang@outlook.com>
Signed-off-by: Haili Zhang <haili.zhang@outlook.com>
Signed-off-by: Haili Zhang <haili.zhang@outlook.com>
Signed-off-by: Haili Zhang <haili.zhang@outlook.com>
f875712 to
63b7b79
Compare
Collaborator
Author
|
@benjaminhuo please help check whether the |
benjaminhuo
reviewed
May 16, 2022
benjaminhuo
reviewed
May 16, 2022
benjaminhuo
reviewed
May 16, 2022
benjaminhuo
reviewed
May 16, 2022
Signed-off-by: Haili Zhang <haili.zhang@outlook.com>
Signed-off-by: Haili Zhang <haili.zhang@outlook.com>
Signed-off-by: Haili Zhang <haili.zhang@outlook.com>
Collaborator
Author
|
@benjaminhuo please help review latest updates, many thanks. |
benjaminhuo
reviewed
May 18, 2022
| ctx.setTrigger(req, res); | ||
|
|
||
| Promise.resolve() | ||
| .then(() => userFunction(ctx, req.body)) |
Member
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #6