Example #1
0
        public FindProcessByIdResult FindProcessById(FindProcessByIdParams @params)
        {
            var response =
                SendMessage <FindProcessByIdRequest, FindProcessByIdResponse>(new FindProcessByIdRequest(@params));

            return(response.result);
        }
            public void SendsRequestWithParams()
            {
                var @params = new FindProcessByIdParams
                {
                    id = new Random().Next(10000),
                };

                Client.FindProcessById(@params);

                MessagingClient.Received(1).SendMessageAsync <FindProcessByIdRequest, FindProcessByIdResponse>(
                    Arg.Is <FindProcessByIdRequest>(request => request.@params == @params)
                    );
            }
 public IProcess FindProcessById(int id)
 {
     var @params = new FindProcessByIdParams
     {
         id = id,
     };
     var result = hostClient.FindProcessById(@params);
     if (result == null)
     {
         return null;
     }
     var env = result.environment.ToDictionary(pair => pair.Key, pair => pair.Value);
     return new ConstrainedProcess(hostClient, result.processKey, result.id, env);
 }
Example #4
0
        public IProcess FindProcessById(int id)
        {
            var @params = new FindProcessByIdParams
            {
                id = id,
            };
            var result = hostClient.FindProcessById(@params);

            if (result == null)
            {
                return(null);
            }
            var env = result.environment.ToDictionary(pair => pair.Key, pair => pair.Value);

            return(new ConstrainedProcess(hostClient, result.processKey, result.id, env));
        }
        public Task<FindProcessByIdResult> ExecuteAsync(FindProcessByIdParams p)
        {
            IProcess process;
            var processKey = processTracker.GetProcessById(p.id, out process);
            if (process == null)
            {
                return Task.FromResult(null as FindProcessByIdResult);
            }

            var result = new FindProcessByIdResult
            {
                id = process.Id,
                processKey = processKey,
                environment = process.Environment
            };

            return Task.FromResult(result);
        }
Example #6
0
        public Task <FindProcessByIdResult> ExecuteAsync(FindProcessByIdParams p)
        {
            IProcess process;
            var      processKey = processTracker.GetProcessById(p.id, out process);

            if (process == null)
            {
                return(Task.FromResult(null as FindProcessByIdResult));
            }

            var result = new FindProcessByIdResult
            {
                id          = process.Id,
                processKey  = processKey,
                environment = process.Environment
            };

            return(Task.FromResult(result));
        }