예제 #1
0
 private void LoopTask(object o)
 {
     Task.Run(async() =>
     {
         var info = await ServerRuntimeRepostory.GetHomeInfo();
         _        = HubContext.Clients.All.SendAsync("serverruntimeinfo", info);
     });
 }
예제 #2
0
 public LinuxRuntimeService(ServerRuntimeRepostory serverRuntimeRepostory)
 {
     ServerRuntimeRepostory = serverRuntimeRepostory;
     CollectionTimer        = new Timer(LoopTask, null, 0, (int)TimeSpan.FromSeconds(1).TotalMilliseconds);
 }
예제 #3
0
 public ServerPublisher(ServerRuntimeRepostory serverRuntimeRepostory, IHubContext <ServerPublishHub> hubContext)
 {
     ServerRuntimeRepostory = serverRuntimeRepostory;
     HubContext             = hubContext;
     CollectionTimer        = new Timer(LoopTask, null, 0, (int)TimeSpan.FromSeconds(1).TotalMilliseconds);
 }