Beispiel #1
0
        public void Handle(SqlRunnerOptions message)
        {
            SimpleLogger.LogThisReallyCrappyMessage("Info", "Handling runner request");

            var runnerActorWrapper = ActorWrapper.GetUserActorSelection(ActorWrapper.RunnerActorName);
            var statusUpdateActor  = ActorWrapper.GetUserActorSelection(ActorWrapper.StatusUpdateActorName);
            var scriptObjects      = RunnableScriptObject.GetFirstScriptFromQueue();

            if (!scriptObjects.Any())
            {
                Sender.Tell(new ThereIsNoDataOnlyZuulMessage(), Self);
                return;
            }

            // double lock
            var script = scriptObjects.ElementAt(0);

            LogResultPickedUp(script, statusUpdateActor);
            var sameScript = RunnableScriptObject.GetDataByScriptId(script.RunnableScriptId);

            if (!sameScript.ProcessInfoIsSame(script))
            {
                runnerActorWrapper.Tell(script, Self);
                Sender.Tell(new GetToTheChopperMessage {
                    ScriptId = script.RunnableScriptId
                }, Self);
            }
            else
            {
                Sender.Tell(new ThereIsNoDataOnlyZuulMessage(), Self);
            }
        }
Beispiel #2
0
        public void Handle(RunnableScriptObject message)
        {
            SimpleLogger.LogThisReallyCrappyMessage("Info", "Handle script run request");
            var storageActor      = ActorWrapper.GetUserActorSelection(ActorWrapper.StorageActorName);
            var scriptPullActor   = ActorWrapper.GetUserActorSelection(ActorWrapper.ScriptPullActorName);
            var statusUpdateActor = ActorWrapper.GetUserActorSelection(ActorWrapper.StatusUpdateActorName);

            try
            {
                // pick it up!
                LogResultProcessing(message, statusUpdateActor);
                GetScriptContentsDataSetResult(message);
                LogResultSuccess(message, storageActor, scriptPullActor, statusUpdateActor);
            }
            catch (Exception e)
            {
                LogResultFailure(message, storageActor, statusUpdateActor, e);
            }
        }