Ejemplo n.º 1
0
            internal void Start()
            {
                process             = new WorkerProcess(this);
                process.Ready      += OnReady;
                process.WorkerLost += OnWorkerLost;

                process.Start(Program.CreateStartInfo());
            }
Ejemplo n.º 2
0
        private WorkerProcess<TrackIRWorker> SetupRealTrackIRDll()
        {
            string realDllPath = DllRegistrar.GetRealTrackIRDllPath(Environment.CurrentDirectory);

            if (realDllPath == null)
                return new WorkerProcess<TrackIRWorker>();

            freepieData.Write(x => x.TrackIRData, new TrackIRData { LastUpdatedTicks = DateTime.Now.Ticks });
            var worker = new WorkerProcess<TrackIRWorker>(Path.Combine(realDllPath, NPClientName).Quote() + " " + Process.GetCurrentProcess().MainWindowHandle.ToInt64() + " " + doLog);
            worker.Start();
            return worker;
        }
Ejemplo n.º 3
0
        private WorkerProcess <TrackIRWorker> SetupRealTrackIRDll()
        {
            string realDllPath = DllRegistrar.GetRealTrackIRDllPath(Environment.CurrentDirectory);

            if (realDllPath == null)
            {
                return(new WorkerProcess <TrackIRWorker>());
            }

            freepieData.Write(x => x.TrackIRData, new TrackIRData {
                LastUpdatedTicks = DateTime.Now.Ticks
            });
            var worker = new WorkerProcess <TrackIRWorker>(Path.Combine(realDllPath, NPClientName).Quote() + " " + Process.GetCurrentProcess().MainWindowHandle.ToInt64() + " " + doLog);

            worker.Start();
            return(worker);
        }
Ejemplo n.º 4
0
        public static void Main(string[] args)
        {
            //TODO: read from configuration / env variables configuration parameters
            var workerProcess = new WorkerProcess(new RabbitMQEventConsumer(host: "localdev", vhost: "/test", username: "******", password: "******"),
                                                  new SpotCharterEventSourceRepository("SpotCharters", "spot_user", "spot_user", host: "localdev"),
                                                  new SpotCharterQueryRepository("localdev", "spotService", username: "******", password: "******"));

            Task.WaitAll(Task.Factory.StartNew(() =>
            {
                Console.WriteLine("Consumer start waiting events from message broker.");
                workerProcess.Start("chartering.spot.viewupdate");
                while (Console.ReadLine() != "quit")
                {
                    ;
                }
                Console.WriteLine("Quitting consumer ...");
                workerProcess.Quit();
                Console.WriteLine("Closing");
            }));
        }