12345678910111213141516171819202122232425 |
- using SMP.Message.Consumer;
- using Topshelf;
- class Program
- {
- static void Main(string[] args)
- {
- HostFactory.Run(x =>
- {
- x.Service<TaskRunner>(s =>
- {
- s.ConstructUsing(name => new TaskRunner());
- s.WhenStarted(tc => tc.Start());
- s.WhenStopped(tc => tc.Stop());
- });
- x.RunAsLocalSystem();
- x.SetDescription("SMP消息服务");
- x.SetDisplayName("SMPMessageService");
- x.SetServiceName("SMPMessageService");
- });
- Console.ReadKey();
- }
- }
|