Exemplo n.º 1
0
        public QueueBasedImplementationRunner(
            ImplementationRunnerConfig config,
            ProcessingRules deployProcessingRules)
        {
            this.config = config;
            this.deployProcessingRules = deployProcessingRules;

            audit = new Audit(config.AuditStream);
        }
Exemplo n.º 2
0
            private static ProcessingRules CreateDeployProcessingRules()
            {
                var deployProcessingRules = new ProcessingRules();

                // Debt - we only need this to consume message from the server
                deployProcessingRules
                .On("display_description")
                .Call(p => "OK")
                .Build();

                return(deployProcessingRules);
            }
Exemplo n.º 3
0
        private Maybe <Request> ApplyProcessingRules(
            Request request,
            ProcessingRules processingRules,
            RemoteBroker remoteBroker)
        {
            audit.StartLine();
            audit.Log(request);

            var response = processingRules.GetResponseFor(request);

            audit.Log(response);

            audit.EndLine();

            AfterResponse(remoteBroker, request, response);

            return(GetNextRequest(remoteBroker, response));
        }
Exemplo n.º 4
0
        public void GoLiveWith(ProcessingRules processingRules)
        {
            audit.LogLine("Starting client");

            try
            {
                using (var remoteBroker = new RemoteBroker(hostname, port, uniqueId, TimeToWaitForRequests))
                {
                    audit.LogLine("Waiting for requests");
                    var request = remoteBroker.Receive();
                    while (request.HasValue)
                    {
                        request = ApplyProcessingRules(request.Value, processingRules, remoteBroker);
                    }
                }
            }
            catch (Exception ex)
            {
                audit.LogException("There was a problem processing messages", ex);
            }

            audit.LogLine("Stopping client");
        }
Exemplo n.º 5
0
 public Builder()
 {
     deployProcessingRules = CreateDeployProcessingRules();
 }
 public Builder(string methodName, ProcessingRules processingRules)
 {
     this.methodName      = methodName;
     this.processingRules = processingRules;
 }