@@ -67,10 +67,18 @@ message StreamingMessage {
6767
6868 // Worker logs a message back to the host
6969 RpcLog rpc_log = 2 ;
70-
70+
7171 FunctionEnvironmentReloadRequest function_environment_reload_request = 25 ;
7272
7373 FunctionEnvironmentReloadResponse function_environment_reload_response = 26 ;
74+
75+ // Ask the worker to close any open shared memory resources for a given invocation
76+ CloseSharedMemoryResourcesRequest close_shared_memory_resources_request = 27 ;
77+ CloseSharedMemoryResourcesResponse close_shared_memory_resources_response = 28 ;
78+
79+ // Worker indexing message types
80+ FunctionsMetadataRequest functions_metadata_request = 29 ;
81+ FunctionMetadataResponses function_metadata_responses = 30 ;
7482 }
7583}
7684
@@ -201,6 +209,17 @@ message FunctionEnvironmentReloadResponse {
201209 StatusResult result = 3 ;
202210}
203211
212+ // Tell the out-of-proc worker to close any shared memory maps it allocated for given invocation
213+ message CloseSharedMemoryResourcesRequest {
214+ repeated string map_names = 1 ;
215+ }
216+
217+ // Response from the worker indicating which of the shared memory maps have been successfully closed and which have not been closed
218+ // The key (string) is the map name and the value (bool) is true if it was closed, false if not
219+ message CloseSharedMemoryResourcesResponse {
220+ map <string , bool > close_map_results = 1 ;
221+ }
222+
204223// Host tells the worker to load a Function
205224message FunctionLoadRequest {
206225 // unique function identifier (avoid name collisions, facilitate reload case)
@@ -245,6 +264,30 @@ message RpcFunctionMetadata {
245264
246265 // Is set to true for proxy
247266 bool is_proxy = 7 ;
267+
268+ // Function indexing status
269+ StatusResult status = 8 ;
270+
271+ // Function language
272+ string language = 9 ;
273+
274+ // Raw binding info
275+ repeated string raw_bindings = 10 ;
276+ }
277+
278+ // Host tells worker it is ready to receive metadata
279+ message FunctionsMetadataRequest {
280+ // base directory for function app
281+ string function_app_directory = 1 ;
282+ }
283+
284+ // Worker sends function metadata back to host
285+ message FunctionMetadataResponses {
286+ // list of function indexing responses
287+ repeated FunctionLoadRequest function_load_requests_results = 1 ;
288+
289+ // status of overall metadata request
290+ StatusResult result = 2 ;
248291}
249292
250293// Host requests worker to invoke a Function
@@ -263,6 +306,9 @@ message InvocationRequest {
263306
264307 // Populates activityId, tracestate and tags from host
265308 RpcTraceContext trace_context = 5 ;
309+
310+ // Current retry context
311+ RetryContext retry_context = 6 ;
266312}
267313
268314// Host sends ActivityId, traceStateString and Tags from host
@@ -277,6 +323,18 @@ message RpcTraceContext {
277323 map <string , string > attributes = 3 ;
278324}
279325
326+ // Host sends retry context for a function invocation
327+ message RetryContext {
328+ // Current retry count
329+ int32 retry_count = 1 ;
330+
331+ // Max retry count
332+ int32 max_retry_count = 2 ;
333+
334+ // Exception that caused the retry
335+ RpcException exception = 3 ;
336+ }
337+
280338// Host requests worker to cancel invocation
281339message InvocationCancel {
282340 // Unique id for invocation
@@ -318,6 +376,34 @@ message TypedData {
318376 }
319377}
320378
379+ // Specify which type of data is contained in the shared memory region being read
380+ enum RpcDataType {
381+ unknown = 0 ;
382+ string = 1 ;
383+ json = 2 ;
384+ bytes = 3 ;
385+ stream = 4 ;
386+ http = 5 ;
387+ int = 6 ;
388+ double = 7 ;
389+ collection_bytes = 8 ;
390+ collection_string = 9 ;
391+ collection_double = 10 ;
392+ collection_sint64 = 11 ;
393+ }
394+
395+ // Used to provide metadata about shared memory region to read data from
396+ message RpcSharedMemory {
397+ // Name of the shared memory map containing data
398+ string name = 1 ;
399+ // Offset in the shared memory map to start reading data from
400+ int64 offset = 2 ;
401+ // Number of bytes to read (starting from the offset)
402+ int64 count = 3 ;
403+ // Final type to which the read data (in bytes) is to be interpreted as
404+ RpcDataType type = 4 ;
405+ }
406+
321407// Used to encapsulate collection string
322408message CollectionString {
323409 repeated string string = 1 ;
@@ -343,8 +429,13 @@ message ParameterBinding {
343429 // Name for the binding
344430 string name = 1 ;
345431
346- // Data for the binding
347- TypedData data = 2 ;
432+ oneof rpc_data {
433+ // Data for the binding
434+ TypedData data = 2 ;
435+
436+ // Metadata about the shared memory region to read data from
437+ RpcSharedMemory rpc_shared_memory = 3 ;
438+ }
348439}
349440
350441// Used to describe a given binding on load
@@ -390,8 +481,9 @@ message RpcLog {
390481
391482 // Category of the log. Defaults to User if not specified.
392483 enum RpcLogCategory {
393- User = 0 ;
394- System = 1 ;
484+ User = 0 ;
485+ System = 1 ;
486+ CustomMetric = 2 ;
395487 }
396488
397489 // Unique id for invocation (if exists)
@@ -413,11 +505,14 @@ message RpcLog {
413505 // Exception (if exists)
414506 RpcException exception = 6 ;
415507
416- // json serialized property bag, or could use a type scheme like map<string, TypedData>
508+ // json serialized property bag
417509 string properties = 7 ;
418510
419- // Category of the log. Either user(default) or system .
511+ // Category of the log. Either user(default), system, or custom metric .
420512 RpcLogCategory log_category = 8 ;
513+
514+ // strongly-typed (ish) property bag
515+ map <string , TypedData > propertiesMap = 9 ;
421516}
422517
423518// Encapsulates an Exception
@@ -484,4 +579,7 @@ message RpcHttp {
484579 TypedData rawBody = 17 ;
485580 repeated RpcClaimsIdentity identities = 18 ;
486581 repeated RpcHttpCookie cookies = 19 ;
582+ map <string ,NullableString > nullable_headers = 20 ;
583+ map <string ,NullableString > nullable_params = 21 ;
584+ map <string ,NullableString > nullable_query = 22 ;
487585}
0 commit comments