Ejemplo n.º 1
0
        public void SendInvoke(ICallable function, IBindingEnvironment environment, object[] arguments)
        {
            AgentTask task = new AgentTask()
            {
                Callable = function, Environment = environment, Arguments = arguments
            };

            this.channel.Send(task);
        }
Ejemplo n.º 2
0
        private void Execute(object parameter)
        {
            Machine machine = (Machine)parameter;

            machine.SetCurrent();

            while (true)
            {
                try
                {
                    object    obj  = this.channel.Receive();
                    AgentTask task = (AgentTask)obj;

                    task.Callable.Invoke(task.Environment, task.Arguments);
                }
                catch (Exception ex)
                {
                    // TODO review output
                    Console.Error.WriteLine(ex.Message);
                    Console.Error.WriteLine(ex.StackTrace);
                }
            }
        }