static void Main(string[] args) { var x = new PollerBuilder(); x.SetDescription("Rewardle's Points Commands Service") .SetDisplayName("PointsCommands") .SetServiceName("PointsCommands") .OverideServiceConfiguration(d => d.RunAsLocalService()) .RegisterComponents(builder => { builder.RegisterType<FakeServie>().As<IFakeService>(); }) .WithMultipleThreadsPerTask<ExampleTask>("HOla", "Description", 1, 3) //.WithTask<OtherTask>("dd", "Description", 4) .OnException((sender, ex) => { Console.WriteLine("EXCEPTION: " + ex.Message); return ex; }) .OnLogDebug((sender, message) => Console.WriteLine("DEBUG: " + message)) .OnLogInfo((sender, message) => Console.WriteLine("INFO: " + message)) .OnLogWarning((sender, message) => Console.WriteLine("WARNING: " + message)) .Build() .Start(); }
static void Main(string[] args) { var x = new PollerBuilder(); x.SetDescription("Rewardle's Points Commands Service") .SetDisplayName("PointsCommands") .SetServiceName("PointsCommands") .OverideServiceConfiguration(d => d.RunAsLocalService()) .RegisterComponents(builder => { builder.RegisterType <FakeServie>().As <IFakeService>(); }) .WithMultipleThreadsPerTask <ExampleTask>("HOla", "Description", 1, 3) //.WithTask<OtherTask>("dd", "Description", 4) .OnException((sender, ex) => { Console.WriteLine("EXCEPTION: " + ex.Message); return(ex); }) .OnLogDebug((sender, message) => Console.WriteLine("DEBUG: " + message)) .OnLogInfo((sender, message) => Console.WriteLine("INFO: " + message)) .OnLogWarning((sender, message) => Console.WriteLine("WARNING: " + message)) .Build() .Start(); }
static void Main(string[] args) { XmlConfigurator.Configure(); var builder = new PollerBuilder(); builder.SetDescription("Event Queue Worker for Rewardle.Boilerplate") .SetDisplayName("Rewardle.Boilerplate.Events") .SetServiceName("Rewardle.Boilerplate.Events") .OverideServiceConfiguration(configurator => configurator.RunAsLocalSystem()) .OnException((sender, ex) => { ILog logger = LogManager.GetLogger(sender.GetType()); if (ex is TargetInvocationException) { ex = ex.InnerException; } logger.Error(ex.Message, ex); return(ex); }) .RegisterComponents(b => BootstrapperTasks.RunAllInAssemblies(b, typeof(WireUpEventStore).Assembly, typeof(WireUpDispatchers).Assembly, typeof(WireUpThreadFactory).Assembly)) .WithTask <AsyncEventWorker <BoilerplateEventThreadExecutor> >( "BoilerplateEventWorker", "Process the events of the Boilerplate services", 2) .Build() .Start(); }