public bool WakeJob(int id)
        {
            var request  = new DistributionCommon.Comm.Requests.Wake(id);
            var response = this.SendRequest <DistributionCommon.Comm.Responses.Wake>(request);

            if (response != default(DistributionCommon.Comm.Responses.Wake))
            {
                return(response.Success);
            }

            return(false);
        }
Example #2
0
        private Tuple <bool?, DistributionCommon.Comm.Responses.Base> HandleRequest(DistributionCommon.Comm.Requests.Wake request)
        {
            bool success = false;

            if (this.workers.ContainsKey(request.ID))
            {
                if (!this.workers[request.ID].Awake)
                {
                    this.workers[request.ID].Wake();
                    success = true;
                }
            }

            return(new Tuple <bool?, DistributionCommon.Comm.Responses.Base>(success, new DistributionCommon.Comm.Responses.Wake(success)));
        }