in src/RequestProcessor.cs [418:446]
private StreamingMessage NewStreamingMessageTemplate(string requestId, StreamingMessage.ContentOneofCase msgType, out StatusResult status)
{
// Assume success. The state of the status object can be changed in the caller.
status = new StatusResult() { Status = StatusResult.Types.Status.Success };
var response = new StreamingMessage() { RequestId = requestId };
switch (msgType)
{
case StreamingMessage.ContentOneofCase.WorkerInitResponse:
response.WorkerInitResponse = new WorkerInitResponse() { Result = status };
break;
case StreamingMessage.ContentOneofCase.WorkerStatusResponse:
response.WorkerStatusResponse = new WorkerStatusResponse();
break;
case StreamingMessage.ContentOneofCase.FunctionLoadResponse:
response.FunctionLoadResponse = new FunctionLoadResponse() { Result = status };
break;
case StreamingMessage.ContentOneofCase.InvocationResponse:
response.InvocationResponse = new InvocationResponse() { Result = status };
break;
case StreamingMessage.ContentOneofCase.FunctionEnvironmentReloadResponse:
response.FunctionEnvironmentReloadResponse = new FunctionEnvironmentReloadResponse() { Result = status };
break;
default:
throw new InvalidOperationException("Unreachable code.");
}
return response;
}