Esempio n. 1
0
                    public IEnumerable <IAwaitable> Execute(IServices services)
                    {
                        while (CanExecute(_seg.Jpf, services))
                        {
                            IEnumerable <IJsmInstruction> executable = _seg.GetBodyInstructions();
                            IScriptExecuter executer = ExecutableSegment.GetExecuter(executable);
                            foreach (IAwaitable result in executer.Execute(services))
                            {
                                yield return(result);
                            }

                            // Skip one iteration to give control to other operations.
                            yield return(SpinAwaitable.Instance);
                        }
                    }
Esempio n. 2
0
                    public IEnumerable <IAwaitable> Execute(IServices services)
                    {
                        IEnumerable <IJsmInstruction> executable = GetExecutableInstructions(services);

                        if (executable == null)
                        {
                            yield break;
                        }

                        IScriptExecuter executer = ExecutableSegment.GetExecuter(executable);

                        foreach (IAwaitable result in executer.Execute(services))
                        {
                            yield return(result);
                        }
                    }
 public IEnumerable <IAwaitable> Execute(IServices services)
 {
     foreach (IJsmInstruction instr in _list)
     {
         if (instr is JsmInstruction singleInstruction)
         {
             yield return(singleInstruction.Execute(services));
         }
         else if (instr is ExecutableSegment segment)
         {
             // TODO: Change recursion to the loop
             IScriptExecuter nested = segment.GetExecuter();
             foreach (IAwaitable result in nested.Execute(services))
             {
                 yield return(result);
             }
         }
         else
         {
             throw new NotSupportedException($"Cannot execute instruction [{instr}] of type [{instr.GetType()}].");
         }
     }
 }
Esempio n. 4
0
 public void Add(Int32 scriptId, IScriptExecuter executer)
 {
     _dic.Add(scriptId, executer);
 }
Esempio n. 5
0
 public Executer(IScriptExecuter executer)
 {
     _executer = executer;
 }
Esempio n. 6
0
		public DeployTask(IScriptExecuter scriptExecuter, string sciptsPath, IScriptsProvider scriptsProvider)
		{
			_scriptExecuter = scriptExecuter;
			_sciptsPath = sciptsPath;
			_scriptsProvider = scriptsProvider;
		}