public QueueProcessorService(Settings settings) { Database.SetInitializer<HeatHotmailContext>(null); Database.SetInitializer<HeatYahooContext>(null); _settings = settings; _logger = LogManager.GetCurrentClassLogger(); }
static void Main(string[] args) { var settings = new Settings(ConfigurationManager.AppSettings); HostFactory.Run(host => { host.Service<QueueProcessorService>(svc => { svc.ConstructUsing(q => new QueueProcessorService(settings)); svc.WhenStarted(q => q.Start()); svc.WhenStopped(q => q.Stop()); }); host.SetServiceName("Heat.Services.QueueProcessor"); host.SetDescription("Processes Hotmail and Afc events from Hotmail Email Engines"); host.SetDisplayName("Heat.Services.QueueProcessor"); host.StartAutomatically(); }); }