Example #1
0
        static void Main(string[] args)
        {
            var settings = new Settings(ConfigurationManager.AppSettings);

            HostFactory.Run(host =>
            {
                host.UseNLog();
                host.Service<QueueProcessorService>(svc =>
                {
                    svc.ConstructUsing(q => new QueueProcessorService(settings));
                    svc.WhenStarted(q => q.Start());
                    svc.WhenStopped(q => q.Stop());
                });

                host.SetServiceName("WD40.Tracker.QueueProcessor");
                host.SetDescription("Processes click and conversion events from the WD40 Tracker queue");
                host.SetDisplayName("WD40.Tracker.QueueProcessor");
                host.StartAutomatically();
            });
        }
Example #2
0
 public QueueProcessorService(Settings settings)
 {
     _logger = LogManager.GetCurrentClassLogger();
     _settings = settings;
     DapperExtensions.DapperExtensions.DefaultMapper = typeof(CustomAutoMapper<>);
 }