feat: enable HTTP function trigger async functions by webup ยท Pull Request #10 ยท OpenFunction/functions-framework-nodejs
Navigation Menu
{{ message }}
OpenFunction / functions-framework-nodejs Public
forked from GoogleCloudPlatform/functions-framework-nodejs
- Notifications You must be signed in to change notification settings
- Fork 6
Merged
feat: enable HTTP function trigger async functions#10
feat: enable HTTP function trigger async functions#10
Conversation
Copy link
Collaborator
webup
commented
May 15, 2022
webup
commented
Resolves #6
- Enable Knative invoke async
- Refine e2e and conformance tests
- Update README and API docs
auto-assign
bot
requested a review
from benjaminhuo
auto-assign
bot
assigned
webup
webup added 4 commits
May 15, 2022 16:59Signed-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>
webup
force-pushed
the
feature/sync-trigger-async
branch
from
f875712 to
63b7b79
Compare
Copy link
Collaborator Author
webup
commented
May 15, 2022
webup commented
May 15, 2022@benjaminhuo please help check whether the tryKnativeAsync sample in README is correct, thanks.
benjaminhuo reviewed May 16, 2022
src/function_wrappers.ts
Outdated
Show resolved
Hide resolved
src/function_wrappers.ts Outdated Show resolved Hide resolved
benjaminhuo reviewed May 16, 2022
src/function_wrappers.ts
Outdated
Show resolved
Hide resolved
src/function_wrappers.ts Outdated Show resolved Hide resolved
benjaminhuo reviewed May 16, 2022
src/function_wrappers.ts
Show resolved
Hide resolved
src/function_wrappers.ts Show resolved Hide resolved
benjaminhuo reviewed May 16, 2022
src/function_wrappers.ts
Show resolved
Hide resolved
src/function_wrappers.ts Show resolved Hide resolved
webup added 3 commits
May 16, 2022 21:25Signed-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>
Copy link
Collaborator Author
webup
commented
May 17, 2022
webup commented
May 17, 2022@benjaminhuo please help review latest updates, many thanks.
webup
merged commit
5eceefd
into
master
webup
deleted the
feature/sync-trigger-async
branch
benjaminhuo reviewed May 18, 2022
| ctx.setTrigger(req, res); | ||
|
|
||
| Promise.resolve() | ||
| .then(() => userFunction(ctx, req.body)) |
Copy link
Member
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
webup
mentioned this pull request
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