@@ -26,21 +26,18 @@ message StreamingMessage {
26
26
oneof content {
27
27
28
28
// Worker initiates stream
29
- StartStream start_stream = 20 ;
29
+ StartStream start_stream = 20 ;
30
30
31
31
// Host sends capabilities/init data to worker
32
32
WorkerInitRequest worker_init_request = 17 ;
33
33
// Worker responds after initializing with its capabilities & status
34
34
WorkerInitResponse worker_init_response = 16 ;
35
35
36
- // Worker periodically sends empty heartbeat message to host
37
- WorkerHeartbeat worker_heartbeat = 15 ;
38
-
39
36
// Host sends terminate message to worker.
40
37
// Worker terminates if it can, otherwise host terminates after a grace period
41
38
WorkerTerminate worker_terminate = 14 ;
42
39
43
- // Add any worker relevant status to response
40
+ // Host periodically sends status request to the worker
44
41
WorkerStatusRequest worker_status_request = 12 ;
45
42
WorkerStatusResponse worker_status_response = 13 ;
46
43
@@ -49,25 +46,25 @@ message StreamingMessage {
49
46
50
47
// Worker requests a desired action (restart worker, reload function)
51
48
WorkerActionResponse worker_action_response = 7 ;
52
-
49
+
53
50
// Host sends required metadata to worker to load function
54
51
FunctionLoadRequest function_load_request = 8 ;
55
52
// Worker responds after loading with the load result
56
53
FunctionLoadResponse function_load_response = 9 ;
57
-
54
+
58
55
// Host requests a given invocation
59
56
InvocationRequest invocation_request = 4 ;
60
57
61
58
// Worker responds to a given invocation
62
59
InvocationResponse invocation_response = 5 ;
63
60
64
- // Host sends cancel message to attempt to cancel an invocation.
61
+ // Host sends cancel message to attempt to cancel an invocation.
65
62
// If an invocation is cancelled, host will receive an invocation response with status cancelled.
66
63
InvocationCancel invocation_cancel = 21 ;
67
64
68
65
// Worker logs a message back to the host
69
66
RpcLog rpc_log = 2 ;
70
-
67
+
71
68
FunctionEnvironmentReloadRequest function_environment_reload_request = 25 ;
72
69
73
70
FunctionEnvironmentReloadResponse function_environment_reload_response = 26 ;
@@ -78,22 +75,28 @@ message StreamingMessage {
78
75
79
76
// Worker indexing message types
80
77
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 ;
82
85
}
83
86
}
84
87
85
88
// Process.Start required info
86
89
// connection details
87
90
// protocol type
88
- // protocol version
91
+ // protocol version
89
92
90
93
// Worker sends the host information identifying itself
91
94
message StartStream {
92
95
// id of the worker
93
96
string worker_id = 2 ;
94
97
}
95
98
96
- // Host requests the worker to initialize itself
99
+ // Host requests the worker to initialize itself
97
100
message WorkerInitRequest {
98
101
// version of the host sending init request
99
102
string host_version = 1 ;
@@ -107,6 +110,9 @@ message WorkerInitRequest {
107
110
108
111
// Full path of worker.config.json location
109
112
string worker_directory = 4 ;
113
+
114
+ // base directory for function app
115
+ string function_app_directory = 5 ;
110
116
}
111
117
112
118
// Worker responds with the result of initializing itself
@@ -141,11 +147,6 @@ message StatusResult {
141
147
repeated RpcLog logs = 3 ;
142
148
}
143
149
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
-
149
150
// Warning before killing the process after grace_period
150
151
// Worker self terminates ..no response on this
151
152
message WorkerTerminate {
@@ -176,24 +177,25 @@ message FileChangeEventRequest {
176
177
177
178
// Indicates whether worker reloaded successfully or needs a restart
178
179
message WorkerActionResponse {
179
- // indicates whether a restart is needed, or reload succesfully
180
+ // indicates whether a restart is needed, or reload successfully
180
181
enum Action {
181
182
Restart = 0 ;
182
183
Reload = 1 ;
183
184
}
184
-
185
+
185
186
// action for this response
186
187
Action action = 1 ;
187
188
188
189
// text reason for the response
189
190
string reason = 2 ;
190
191
}
191
192
192
- // NOT USED
193
- message WorkerStatusRequest {
193
+ // Used by the host to determine worker health
194
+ message WorkerStatusRequest {
194
195
}
195
196
196
- // NOT USED
197
+ // Worker responds with status message
198
+ // TODO: Add any worker relevant status to response
197
199
message WorkerStatusResponse {
198
200
}
199
201
@@ -220,7 +222,17 @@ message CloseSharedMemoryResourcesResponse {
220
222
map <string , bool > close_map_results = 1 ;
221
223
}
222
224
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
224
236
message FunctionLoadRequest {
225
237
// unique function identifier (avoid name collisions, facilitate reload case)
226
238
string function_id = 1 ;
@@ -252,7 +264,7 @@ message RpcFunctionMetadata {
252
264
253
265
// base directory for the Function
254
266
string directory = 1 ;
255
-
267
+
256
268
// Script file specified
257
269
string script_file = 2 ;
258
270
@@ -273,6 +285,12 @@ message RpcFunctionMetadata {
273
285
274
286
// Raw binding info
275
287
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 ;
276
294
}
277
295
278
296
// Host tells worker it is ready to receive metadata
@@ -282,12 +300,15 @@ message FunctionsMetadataRequest {
282
300
}
283
301
284
302
// Worker sends function metadata back to host
285
- message FunctionMetadataResponses {
303
+ message FunctionMetadataResponse {
286
304
// list of function indexing responses
287
- repeated FunctionLoadRequest function_load_requests_results = 1 ;
305
+ repeated RpcFunctionMetadata function_metadata_results = 1 ;
288
306
289
307
// status of overall metadata request
290
308
StatusResult result = 2 ;
309
+
310
+ // if set to true then host will perform indexing
311
+ bool use_default_metadata_indexing = 3 ;
291
312
}
292
313
293
314
// Host requests worker to invoke a Function
@@ -464,7 +485,7 @@ message BindingInfo {
464
485
DataType data_type = 4 ;
465
486
}
466
487
467
- // Used to send logs back to the Host
488
+ // Used to send logs back to the Host
468
489
message RpcLog {
469
490
// Matching ILogger semantics
470
491
// https://github.com/aspnet/Logging/blob/9506ccc3f3491488fe88010ef8b9eb64594abf95/src/Microsoft.Extensions.Logging/Logger.cs
@@ -515,7 +536,7 @@ message RpcLog {
515
536
map <string , TypedData > propertiesMap = 9 ;
516
537
}
517
538
518
- // Encapsulates an Exception
539
+ // Encapsulates an Exception
519
540
message RpcException {
520
541
// Source of the exception
521
542
string source = 3 ;
@@ -525,6 +546,14 @@ message RpcException {
525
546
526
547
// Textual message describing the exception
527
548
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 ;
528
557
}
529
558
530
559
// Http cookie type. Note that only name and value are used for Http requests
@@ -569,7 +598,7 @@ message RpcHttpCookie {
569
598
// TODO - solidify this or remove it
570
599
message RpcHttp {
571
600
string method = 1 ;
572
- string url = 2 ;
601
+ string url = 2 ;
573
602
map <string ,string > headers = 3 ;
574
603
TypedData body = 4 ;
575
604
map <string ,string > params = 10 ;
0 commit comments