Exemplo n.º 1
0
 public static void Main(string[] args) {
     var userData = EC2Runner.userData();
     var q = new SqsQ((string) userData.get("requestQueue"));
     while(trueDat()) {
         var messages = q.messagesBlocking();
         each<Message>(messages, message => {
             var request = (TestEC2.TestRequest) message.@object();
             request.sendResponse();
             message.delete();
         });
     }
 }
Exemplo n.º 2
0
        protected override void OnStart(string[] args)
        {
            var timeSync = Process.Start(@"C:\WINDOWS\system32\w32tm.exe", "/resync");

            if (timeSync == null)
            {
                throw Bomb.toss("unable to start time sync process");
            }
            timeSync.WaitForExit();
            var userData = EC2Runner.userData();
            var nProcs   = int.Parse((string)userData.get("numProcs"));
            var command  = (string)userData.get("command");

            new EC2Runner((string)userData.get("requestQueue")).downloadJarsAndQRunFromS3(new QDirectory("E:/svn"));
            Environment.SetEnvironmentVariable("MAIN", @"E:\svn");
            O.zeroTo(nProcs, i => startProcess(command));
        }