forked from GoogleCloudPlatform/functions-framework-python
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathasync-server.puml
More file actions
59 lines (41 loc) · 1.39 KB
/
async-server.puml
File metadata and controls
59 lines (41 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
@startuml Async Server
box Function Process in Local Environment or Container
control ENTRYPOINT
participant "~__main__" as Main
participant AsyncServer
participant DaprServer
participant gRPCServer [
Web Server
----
""gprc.server""
]
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 -> gRPCServer ** : ""new""
|||
DaprServer --> DaprSidecar : Waiting till Dapr sidecar started
...
AsyncServer -> DaprServer : register __user function__ as handler \nfor each of __inputs__ in __context__
DaprServer -> gRPCServer : add routes for Dapr style \nsubscriptions and input bindings
...
== OpenFunction Triggering ==
DaprSidecar <-- : sub / input data
DaprSidecar -> gRPCServer ++ : Dapr request with "data"
gRPCServer -> gRPCServer ++ : invoke user function
alt
gRPCServer -> DaprSidecar ++ : publish data or invoke output binding
DaprSidecar --> gRPCServer -- : execution result
end
return
return server app response
...
@enduml