Created
January 26, 2022 13:55
-
-
Save AurelianTactics/b4a9e29c429bf07ae2335d6d9ee0fa3a to your computer and use it in GitHub Desktop.
BasicEnvWithGRPC DmEnvRpcImpl.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//requests and responses are a bidirection gRPC stream. | |
while (await requestStream.MoveNext()) | |
{ | |
// A request is received | |
EnvironmentRequest envRequest = requestStream.Current; | |
// add the request to the RequestQUeu | |
this.requestQueue.AddRequestQueueObject(envRequest); | |
// ask the session layer to do its work and generate a reponse to send to the client | |
var envResponseList = await this.agentSession.HandleEnvironmentRequest(); | |
foreach (DmEnvRpc.V1.EnvironmentResponse ero in envResponseList) | |
{ | |
// send a response to the client | |
await responseStream.WriteAsync(ero); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment