Ejemplo n.º 1
0
        /// <summary>
        /// Executes the prepared statement for each parameter set provided, or once if there are
        /// no parameters supplied.
        /// </summary>
        /// <param name="contexts">
        ///     Holds ExecutionContext objects and parameter metadata for execution. There is one
        ///     ExecutionContext for each parameter set to be executed.
        /// </param>
        /// <param name="warningListener">Used to post warnings about the execution.</param>
        public void Execute(ExecutionContexts contexts, IWarningListener warningListener)
        {
            LogUtilities.LogFunctionEntrance(Log, contexts, warningListener);

            //mark all context as success
            foreach (ExecutionContext context in contexts)
            {
                context.Succeeded = true;
            }
        }
Ejemplo n.º 2
0
 public static void Main()
 {
     ThreadPoolDemo.Go();
     ExecutionContexts.Go();
     CancellationDemo.Go();
     TaskDemo.Go();
     ParallelDemo.Go();
     ParallelLinq.Go();
     TimerDemo.Go();
     FalseSharing.Go();
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates an Agent.
        /// </summary>
        public Agent()
        {
            //https://tc39.github.io/ecma262/#sec-initializehostdefinedrealm

            var realm      = new Realm(this, "Default");
            var newContext = new ExecutionContext(realm, null, true);

            ExecutionContexts.Add(newContext);
            RunningExecutionContext = newContext;
            realm.SetRealmGlobalObject(null, null);
            realm.SetDefaultGlobalBindings();
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Runs the next job.
        /// </summary>
        public void RunNextJob()
        {
            Debug.Assert(ExecutionContexts.Count == 1 && RunningExecutionContext == ExecutionContexts[0]);
            ExecutionContexts.Clear();

            var nextQueue   = promiseJobs.Count > 0 ? promiseJobs : scriptJobs;
            var nextPending = nextQueue.Dequeue();
            var newContext  = new ExecutionContext(nextPending.Realm, nextPending.ScriptOrModule, true);

            ExecutionContexts.Add(newContext);
            RunningExecutionContext = newContext;
            nextPending.Callback();
        }
Ejemplo n.º 5
0
 private void Execute()
 {
     ExecutionContexts.ForEach(c =>
     {
         c.Init();
         var toBeExecutedCops = StyleCopTypes.Where(t => AvailableCopNames.Contains(t.Name))
                                .Select(t => (ASTTraverseHandler)Activator.CreateInstance(t))
                                .ToList();
         var handlerManager = new ASTTraverseManager(toBeExecutedCops);
         handlerManager.RunHandlers(c);
         OutputLog(c);
         c.HasRun = true;
         OnContextExecuted(c);
     });
 }
Ejemplo n.º 6
0
        public void Execute(
            ExecutionContexts contexts,
            IWarningListener warningListener)
        {
            // TODO(ADO)  #11: Implement Query Execution.

            LogUtilities.LogFunctionEntrance(_log, contexts, warningListener);

            // The contexts argument provides access to the parameters that were not pushed.
            // Statement execution is a 3 step process:
            //      1. Serialize all input parameters into a form that can be consumed by the data
            //         source. If your data source does not support parameter streaming for pushed
            //         parameters, then you will need to re-assemble them from your parameter cache.
            //         See PushParamData.
            //      2. Send the Execute() message.
            //      3. Retrieve all output parameters from the server and update the contexts with
            //         their contents.

            // No action needs to be taken here since the results are static and encapsulated in
            // ULPersonTable and DSISimpleRowCountResult.
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Executes the prepared statement for each parameter set provided, or once if there are
        /// no parameters supplied.
        /// </summary>
        /// <param name="contexts">
        ///     Holds ExecutionContext objects and parameter metadata for execution. There is one
        ///     ExecutionContext for each parameter set to be executed.
        /// </param>
        /// <param name="warningListener">Used to post warnings about the execution.</param>
        public void Execute(ExecutionContexts contexts, IWarningListener warningListener)
        {
            LogUtilities.LogFunctionEntrance(Log, contexts, warningListener);

            //mark all context as success
            foreach (ExecutionContext context in contexts)
                context.Succeeded = true;
            


        }