forked from GoogleCloudPlatform/functions-framework-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 6
feat: initialize openfunction knative and async runtime #4
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
402437f
✨ feat: initialize ofn knative and async runtimes
webup a8d551a
➖ chore: remove self dep
webup 56a04f0
🎨 cosm: code style and comment polish
webup 8d8dcbe
🎨 cosm: refine the naming of dapr output middleware
webup 939925c
🔨 dep: require node engine >= 13
webup e5be7b8
📝 docs(api): update api-extractor generated docs
webup b2373e0
📝 docs(README): refine some feature descriptions
webup File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
node_modules/ | ||
build/ | ||
.coverage/ | ||
.history/ | ||
npm-debug.log | ||
.nyc_output | ||
.vscode | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
@startuml Async Server | ||
|
||
box Function Process in Local Environment or Container | ||
control ENTRYPOINT | ||
participant Main | ||
participant AsyncServer | ||
participant DaprServer | ||
participant Restana [ | ||
Web Server | ||
---- | ||
""Restana"" | ||
] | ||
end box | ||
|
||
entity "Dapr Sidecar " as DaprSidecar | ||
|
||
== OpenFunction Serving == | ||
|
||
ENTRYPOINT -> Main ** : execute | ||
note over ENTRYPOINT, Main: Pass through __CLI arguments__ and \ncontainer __environment variables__ | ||
|
||
Main -> Main : load user function file | ||
note left: ""function (ctx, data) {}"" | ||
|
||
Main -> AsyncServer ** : create | ||
note over Main, AsyncServer: Hand over __user function__ and __context__ | ||
|
||
AsyncServer -> DaprServer ** : ""new"" | ||
note over AsyncServer, DaprServer: Extract __port__ from __context__ and pass down | ||
|
||
DaprServer -> Restana ** : ""new"" | ||
note over Restana: Super fast and minimalist framework \nfor building REST micro-services | ||
||| | ||
DaprServer --> DaprSidecar : Waiting till Dapr sidecar started | ||
note over DaprServer, DaprSidecar #FFAAAA: Using HTTP channel due to lack of good support of gRPC in Dapr Node.js SDK | ||
... | ||
AsyncServer -> DaprServer : register __user function__ as handler \nfor each of __inputs__ in __context__ | ||
DaprServer -> Restana : add routes for Dapr style \nsubscriptions and input bindings | ||
|
||
... | ||
|
||
== OpenFunction Triggering == | ||
|
||
DaprSidecar <--] : sub / input data | ||
|
||
DaprSidecar -> Restana ++ : Dapr request with "data" | ||
|
||
Restana -> Restana ++ : invoke user function | ||
|
||
alt | ||
Restana -> DaprSidecar ++ : publish data or invoke output binding | ||
DaprSidecar --> Restana -- : execution result | ||
end | ||
|
||
return | ||
|
||
return server app response | ||
|
||
... | ||
|
||
@enduml |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.