public override Task <GetNumModulesResponse> GetNumModules(GetNumModulesRequest request,
                                                                   ServerCallContext context)
        {
            if (!_targetStore.TryGetValue(request.Target.Id, out RemoteTarget target))
            {
                ErrorUtils.ThrowError(StatusCode.Internal,
                                      "Could not find target in store: " + request.Target.Id);
            }

            var response = new GetNumModulesResponse();

            response.Result = target.GetNumModules();
            return(Task.FromResult(response));
        }
Exemple #2
0
        public int GetNumModules()
        {
            var request = new GetNumModulesRequest()
            {
                Target = grpcSbTarget,
            };
            GetNumModulesResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.GetNumModules(request);
            }))
            {
                return(response.Result);
            }
            return(0);
        }