Ejemplo n.º 1
0
        public static int Main(string[] args)
        {
            Logger.Info("Application started.");

            AppDomain.CurrentDomain.UnhandledException += OnUnhandledApplicationException;

            // Log the exception, but do not mark it as observed. The process will be terminated and restarted
            // automatically by AppHarbor
            TaskScheduler.UnobservedTaskException +=
                (sender, e) => Logger.ErrorException("An unobserved task exception occurred", e.Exception);

            var gateway = new RedisConnectionGateway(ConfigurationManager.AppSettings["REDISTOGO_URL"]);

            queue = new RedisExecutionQueue(Serializer, gateway, 0, "queue:execute");
            messenger = new RedisMessenger(gateway);

            ProcessQueue();

            return -1; // Return a non-zero code so AppHarbor restarts the worker
        }
Ejemplo n.º 2
0
 public RedisMessenger(RedisConnectionGateway redisConnectionGateway)
 {
     gateway = redisConnectionGateway;
     Subscribe();
 }