File tree Expand file tree Collapse file tree 4 files changed +15
-36
lines changed Expand file tree Collapse file tree 4 files changed +15
-36
lines changed Original file line number Diff line number Diff line change 11using System ;
22using InEngine . Core . Queuing ;
33using InEngine . Core . Scheduling ;
4- using Quartz ;
5- using Quartz . Impl ;
64
7- namespace InEngine
5+ namespace InEngine . Core
86{
97 public class ServerHost : IDisposable
108 {
@@ -27,10 +25,10 @@ public void Dispose()
2725 public void Start ( )
2826 {
2927 SuperScheduler . Start ( ) ;
30- StartQueueServerAsync ( ) ;
28+ StartDequeueAsync ( ) ;
3129 }
3230
33- public async void StartQueueServerAsync ( )
31+ public async void StartDequeueAsync ( )
3432 {
3533 await Dequeue . StartAsync ( ) ;
3634 }
Original file line number Diff line number Diff line change 11using System ;
22using System . IO ;
33using System . ServiceProcess ;
4+ using InEngine . Core ;
45using Mono . Unix ;
56using Mono . Unix . Native ;
67
Original file line number Diff line number Diff line change 1- using System . Threading ;
2- using System . Threading . Tasks ;
3- using System . Web ;
1+ using System . Web ;
42using System . Web . Mvc ;
53using System . Web . Routing ;
6- using InEngine . Core . Queuing ;
7- using InEngine . Core . Scheduling ;
4+ using InEngine . Core ;
85
96namespace SampleMvcWebsite
107{
118 public class Global : HttpApplication
129 {
13- public SuperScheduler SuperScheduler { get ; set ; }
14- public Dequeue Dequeue { get ; set ; }
10+ public ServerHost ServerHost { get ; set ; }
1511
1612 protected void Application_Start ( )
1713 {
1814 AreaRegistration . RegisterAllAreas ( ) ;
1915 RouteConfig . RegisterRoutes ( RouteTable . Routes ) ;
2016
21- SuperScheduler = new SuperScheduler ( ) ;
22- SuperScheduler . Initialize ( ) ;
23- SuperScheduler . Start ( ) ;
24- Dequeue = new Dequeue ( ) ;
25- StartQueueServerAsync ( ) ;
26- }
27-
28- async void StartQueueServerAsync ( )
29- {
30- await Dequeue . StartAsync ( ) ;
17+ ServerHost = new ServerHost ( ) ;
18+ ServerHost . Start ( ) ;
3119 }
3220
3321 protected void Application_End ( )
3422 {
35- SuperScheduler ? . Shutdown ( ) ;
23+ ServerHost . Dispose ( ) ;
3624 }
3725 }
3826}
Original file line number Diff line number Diff line change 11using System . Web ;
22using System . Web . Http ;
3- using InEngine . Core . Queuing ;
4- using InEngine . Core . Scheduling ;
3+ using InEngine . Core ;
54
65namespace SampleWebApi
76{
87 public class Global : HttpApplication
98 {
10- public SuperScheduler SuperScheduler { get ; set ; }
11- public Dequeue Dequeue { get ; set ; }
9+ public ServerHost ServerHost { get ; set ; }
1210
1311 protected void Application_Start ( )
1412 {
1513 GlobalConfiguration . Configure ( WebApiConfig . Register ) ;
1614
17- SuperScheduler = new SuperScheduler ( ) ;
18- SuperScheduler . Initialize ( ) ;
19- SuperScheduler . Start ( ) ;
20-
21- Dequeue = new Dequeue ( ) ;
22- StartQueueServerAsync ( ) ;
15+ ServerHost = new ServerHost ( ) ;
16+ ServerHost . Start ( ) ;
2317 }
2418
25- async void StartQueueServerAsync ( ) => await Dequeue . StartAsync ( ) ;
26-
2719 protected void Application_End ( )
2820 {
29- SuperScheduler ? . Shutdown ( ) ;
21+ ServerHost . Dispose ( ) ;
3022 }
3123 }
3224}
You can’t perform that action at this time.
0 commit comments