@@ -26,21 +26,18 @@ message StreamingMessage {
2626 oneof content {
2727
2828 // Worker initiates stream
29- StartStream start_stream = 20 ;
29+ StartStream start_stream = 20 ;
3030
3131 // Host sends capabilities/init data to worker
3232 WorkerInitRequest worker_init_request = 17 ;
3333 // Worker responds after initializing with its capabilities & status
3434 WorkerInitResponse worker_init_response = 16 ;
3535
36- // Worker periodically sends empty heartbeat message to host
37- WorkerHeartbeat worker_heartbeat = 15 ;
38-
3936 // Host sends terminate message to worker.
4037 // Worker terminates if it can, otherwise host terminates after a grace period
4138 WorkerTerminate worker_terminate = 14 ;
4239
43- // Add any worker relevant status to response
40+ // Host periodically sends status request to the worker
4441 WorkerStatusRequest worker_status_request = 12 ;
4542 WorkerStatusResponse worker_status_response = 13 ;
4643
@@ -49,25 +46,25 @@ message StreamingMessage {
4946
5047 // Worker requests a desired action (restart worker, reload function)
5148 WorkerActionResponse worker_action_response = 7 ;
52-
49+
5350 // Host sends required metadata to worker to load function
5451 FunctionLoadRequest function_load_request = 8 ;
5552 // Worker responds after loading with the load result
5653 FunctionLoadResponse function_load_response = 9 ;
57-
54+
5855 // Host requests a given invocation
5956 InvocationRequest invocation_request = 4 ;
6057
6158 // Worker responds to a given invocation
6259 InvocationResponse invocation_response = 5 ;
6360
64- // Host sends cancel message to attempt to cancel an invocation.
61+ // Host sends cancel message to attempt to cancel an invocation.
6562 // If an invocation is cancelled, host will receive an invocation response with status cancelled.
6663 InvocationCancel invocation_cancel = 21 ;
6764
6865 // Worker logs a message back to the host
6966 RpcLog rpc_log = 2 ;
70-
67+
7168 FunctionEnvironmentReloadRequest function_environment_reload_request = 25 ;
7269
7370 FunctionEnvironmentReloadResponse function_environment_reload_response = 26 ;
@@ -78,22 +75,28 @@ message StreamingMessage {
7875
7976 // Worker indexing message types
8077 FunctionsMetadataRequest functions_metadata_request = 29 ;
81- FunctionMetadataResponses function_metadata_responses = 30 ;
78+ FunctionMetadataResponse function_metadata_response = 30 ;
79+
80+ // Host sends required metadata to worker to load functions
81+ FunctionLoadRequestCollection function_load_request_collection = 31 ;
82+
83+ // Host gets the list of function load responses
84+ FunctionLoadResponseCollection function_load_response_collection = 32 ;
8285 }
8386}
8487
8588// Process.Start required info
8689// connection details
8790// protocol type
88- // protocol version
91+ // protocol version
8992
9093// Worker sends the host information identifying itself
9194message StartStream {
9295 // id of the worker
9396 string worker_id = 2 ;
9497}
9598
96- // Host requests the worker to initialize itself
99+ // Host requests the worker to initialize itself
97100message WorkerInitRequest {
98101 // version of the host sending init request
99102 string host_version = 1 ;
@@ -107,6 +110,9 @@ message WorkerInitRequest {
107110
108111 // Full path of worker.config.json location
109112 string worker_directory = 4 ;
113+
114+ // base directory for function app
115+ string function_app_directory = 5 ;
110116}
111117
112118// Worker responds with the result of initializing itself
@@ -141,11 +147,6 @@ message StatusResult {
141147 repeated RpcLog logs = 3 ;
142148}
143149
144- // TODO: investigate grpc heartbeat - don't limit to grpc implemention
145-
146- // Message is empty by design - Will add more fields in future if needed
147- message WorkerHeartbeat {}
148-
149150// Warning before killing the process after grace_period
150151// Worker self terminates ..no response on this
151152message WorkerTerminate {
@@ -176,24 +177,25 @@ message FileChangeEventRequest {
176177
177178// Indicates whether worker reloaded successfully or needs a restart
178179message WorkerActionResponse {
179- // indicates whether a restart is needed, or reload succesfully
180+ // indicates whether a restart is needed, or reload successfully
180181 enum Action {
181182 Restart = 0 ;
182183 Reload = 1 ;
183184 }
184-
185+
185186 // action for this response
186187 Action action = 1 ;
187188
188189 // text reason for the response
189190 string reason = 2 ;
190191}
191192
192- // NOT USED
193- message WorkerStatusRequest {
193+ // Used by the host to determine worker health
194+ message WorkerStatusRequest {
194195}
195196
196- // NOT USED
197+ // Worker responds with status message
198+ // TODO: Add any worker relevant status to response
197199message WorkerStatusResponse {
198200}
199201
@@ -220,7 +222,17 @@ message CloseSharedMemoryResourcesResponse {
220222 map <string , bool > close_map_results = 1 ;
221223}
222224
223- // Host tells the worker to load a Function
225+ // Host tells the worker to load a list of Functions
226+ message FunctionLoadRequestCollection {
227+ repeated FunctionLoadRequest function_load_requests = 1 ;
228+ }
229+
230+ // Host gets the list of function load responses
231+ message FunctionLoadResponseCollection {
232+ repeated FunctionLoadResponse function_load_responses = 1 ;
233+ }
234+
235+ // Load request of a single Function
224236message FunctionLoadRequest {
225237 // unique function identifier (avoid name collisions, facilitate reload case)
226238 string function_id = 1 ;
@@ -252,7 +264,7 @@ message RpcFunctionMetadata {
252264
253265 // base directory for the Function
254266 string directory = 1 ;
255-
267+
256268 // Script file specified
257269 string script_file = 2 ;
258270
@@ -273,6 +285,12 @@ message RpcFunctionMetadata {
273285
274286 // Raw binding info
275287 repeated string raw_bindings = 10 ;
288+
289+ // unique function identifier (avoid name collisions, facilitate reload case)
290+ string function_id = 13 ;
291+
292+ // A flag indicating if managed dependency is enabled or not
293+ bool managed_dependency_enabled = 14 ;
276294}
277295
278296// Host tells worker it is ready to receive metadata
@@ -282,12 +300,15 @@ message FunctionsMetadataRequest {
282300}
283301
284302// Worker sends function metadata back to host
285- message FunctionMetadataResponses {
303+ message FunctionMetadataResponse {
286304 // list of function indexing responses
287- repeated FunctionLoadRequest function_load_requests_results = 1 ;
305+ repeated RpcFunctionMetadata function_metadata_results = 1 ;
288306
289307 // status of overall metadata request
290308 StatusResult result = 2 ;
309+
310+ // if set to true then host will perform indexing
311+ bool use_default_metadata_indexing = 3 ;
291312}
292313
293314// Host requests worker to invoke a Function
@@ -464,7 +485,7 @@ message BindingInfo {
464485 DataType data_type = 4 ;
465486}
466487
467- // Used to send logs back to the Host
488+ // Used to send logs back to the Host
468489message RpcLog {
469490 // Matching ILogger semantics
470491 // https://github.com/aspnet/Logging/blob/9506ccc3f3491488fe88010ef8b9eb64594abf95/src/Microsoft.Extensions.Logging/Logger.cs
@@ -515,7 +536,7 @@ message RpcLog {
515536 map <string , TypedData > propertiesMap = 9 ;
516537}
517538
518- // Encapsulates an Exception
539+ // Encapsulates an Exception
519540message RpcException {
520541 // Source of the exception
521542 string source = 3 ;
@@ -525,6 +546,14 @@ message RpcException {
525546
526547 // Textual message describing the exception
527548 string message = 2 ;
549+
550+ // Worker specifies whether exception is a user exception,
551+ // for purpose of application insights logging. Defaults to false.
552+ optional bool is_user_exception = 4 ;
553+
554+ // Type of exception. If it's a user exception, the type is passed along to app insights.
555+ // Otherwise, it's ignored for now.
556+ optional string type = 5 ;
528557}
529558
530559// Http cookie type. Note that only name and value are used for Http requests
@@ -569,7 +598,7 @@ message RpcHttpCookie {
569598// TODO - solidify this or remove it
570599message RpcHttp {
571600 string method = 1 ;
572- string url = 2 ;
601+ string url = 2 ;
573602 map <string ,string > headers = 3 ;
574603 TypedData body = 4 ;
575604 map <string ,string > params = 10 ;
0 commit comments