public bool Start(HostControl hostControl) { _log = HostLogger.Get <AkkaService>(); _log.Info("Service Starting..."); hostControl.RequestAdditionalTime(TimeSpan.FromSeconds(10)); Thread.Sleep(1000); /* * ThreadPool.QueueUserWorkItem(x => * { * * Thread.Sleep(3000); * _log.Info("Requesting a restart!!!"); * hostControl.Restart(); * _log.Info("Dying an ungraceful death"); * throw new InvalidOperationException("Oh, what a world."); * }); */ _log.Info("AkkaService Started"); _pipeline = new ProcessPipeline(); // Lets subscribe to Data-Stream return(true); }
public async Task <BucketContainer> LoadEventsAsync() { var pipeline = new ProcessPipeline() { new DensityPrecalculation() }; var processor = new ParallelEventsProcessor(pipeline, ProgressHandler); return(await processor.ProcessEventsAsync(_eventReader, _loadPayloads)); }
void Start() { ball = new BallData(gameObject.name, gameObject.transform.position); Gp = GameProcess.pipeline; MsgTemplate = new SQEle(this.ConvToBytes(), DefaultCallback); rb = GetComponent <Rigidbody>(); enabled = false; timer = new Timer(WaitTimeVel); BroadcastTimer = new Timer(BroadcastPeriod); }
void Awake() { fc = new ForceCommand(0.0f, 0.0f, 0.0f, 0.0f, 0); pipeline = new ProcessPipeline(); pipeline.StartPipeLine(); SimTimer = new Stopwatch(); SimFlags = EMPTYHOUSE_FLAG; SimUpdateTimer = new Stopwatch(); SimUpdateTimer.Start(); //SimGameState.jsonprototype(); }
static void Main(string[] args) { try { var logger = new ConsoleLogger(); var options = new Options(); var res = CommandLine.Parser.Default.ParseArguments(args, options); logger.Info("Starting dependency detection"); _dumpOptions(logger, options); // See #4, even a start without params should provide the minimum configuration setup, which is config and dependency walker var config = _readConfig(options.Config); var pathOfDependsRoot = _getDependencyWalkerIfMissing(logger, options.ProxyUser, options.ProxyPassword); if (res == false) { Environment.Exit(1); } var dd = new DependencyDetector(pathOfDependsRoot); IDependencyProvider dependencyProvider = _getDependencyProvider(options); var p = new ProcessPipeline(logger, dd, dependencyProvider); ; // Fail fast: Check if configuration is available config.GetConfigurationSet(options.ConfigurationSetName ?? Config.DefaultSetName); p.ExecutePipeline(options, config); logger.Info("Dependency detection finished"); } catch (Exception e) { Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine(e.ToString()); Environment.Exit(1); } }
public void Setup() { _dependsRoot = Path.Combine(TestDataExtracted, "Depends"); _dependencyRoot = Path.Combine(TestDataExtracted, "x64"); _defaultConfig = Config.CreateDefaultConfig(); _defaultConfig.HowManyIterations = 2; // Manually control sweeps, always at least 2 required // Create scenarios where executable is missing a dependency DirectoryOfExeWithMissingDep = Path.Combine(TestDataOwn, "only_exe"); _defaultOptions = new Options { InputDirectory = DirectoryOfExeWithMissingDep, RecurseInput = false, Config = "config.json", DependencyDirectory = _dependencyRoot }; TearDown(); // DepA { DirectoryOfDepAMissingDepB = Path.Combine(TestDataOwn, "depA"); CreateDir(DirectoryOfDepAMissingDepB); File.Copy(GetExtractedFiles("x64", "*A.dll").First(), Path.Combine(DirectoryOfDepAMissingDepB, "dlla.dll")); } CreateDir(DirectoryOfExeWithMissingDep); var file = GetExtractedFiles("x64", "*.exe").First(); File.Copy(file, Path.Combine(DirectoryOfExeWithMissingDep, "executable.exe")); // Create nested executable { var nestedDir = Path.Combine(DirectoryOfExeWithMissingDep, "inner"); CreateDir(nestedDir); File.Copy(file, Path.Combine(nestedDir, "executable.exe")); } var mock = NSubstitute.Substitute.For <ILogger>(); var dd = new DependencyDetector(_dependsRoot); _pipeline = new ProcessPipeline(mock, dd, new FileCopyDependencyProvider()); }
private static async Task PipelineAsync() { var si = new ProcessPipelineStartInfo() { StdOutputRedirection = OutputRedirection.File, StdOutputFile = "env.txt", }; si.Add("cmd", "/C", "set"); si.Add("findstr", "PROCESSOR"); using (var p = ProcessPipeline.Start(si)) { await p.WaitForExitAsync(); } // NUMBER_OF_PROCESSORS=16 // PROCESSOR_ARCHITECTURE = AMD64 // ... Console.WriteLine(File.ReadAllText("env.txt")); }