示例#1
0
        public void RegisterDriverClientService(Exception exception)
        {
            Logger.Log(Level.Info, "Register driver client error", exception);
            var registration = new DriverClientRegistration
            {
                Exception = GrpcUtils.SerializeException(exception)
            };

            _driverServiceStub.RegisterDriverClient(registration);
        }
示例#2
0
 public override async Task <ExceptionInfo> StopHandler(StopTimeInfo request, ServerCallContext context)
 {
     try
     {
         Logger.Log(Level.Info, "Received stop event at time {0}", request.StopTime);
         await _driverBridge.DispatchStopEvent(new BridgeDriverStopped(new DateTime(request.StopTime)));
     }
     catch (Exception ex)
     {
         Logger.Log(Level.Error, "Driver stop handler error", ex);
         return(GrpcUtils.SerializeException(ex));
     }
     finally
     {
         /* Do not await on shutdown async, which will cause a deadlock since
          * shutdown waits for this method to return.*/
         _server.ShutdownAsync();
     }
     Logger.Log(Level.Info, "Clean stop handler execution");
     return(new ExceptionInfo()
     {
         NoError = true
     });
 }