File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
src/Simplify.Scheduler.IntegrationTester Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1- using Simplify . DI ;
1+ using System ;
2+ using Simplify . DI ;
23using Simplify . Scheduler . IntegrationTester . Setup ;
34
45namespace Simplify . Scheduler . IntegrationTester
@@ -16,6 +17,9 @@ private static void Main(string[] args)
1617
1718 using ( var scheduler = new MultitaskScheduler ( ) )
1819 {
20+ scheduler . OnJobStart += HandlerOnJobStart ;
21+ scheduler . OnJobFinish += HandlerOnJobFinish ;
22+
1923 scheduler . AddJob < OneSecondStepProcessor > ( IocRegistrations . Configuration ) ;
2024 scheduler . AddJob < TwoSecondStepProcessor > ( IocRegistrations . Configuration , startupArgs : "Hello world!!!" ) ;
2125 scheduler . AddJob < OneMinuteStepCrontabProcessor > ( IocRegistrations . Configuration ) ;
@@ -30,5 +34,15 @@ private static void Main(string[] args)
3034 using ( var scope = DIContainer . Current . BeginLifetimeScope ( ) )
3135 scope . Resolver . Resolve < BasicTaskProcessor > ( ) . Run ( ) ;
3236 }
37+
38+ private static void HandlerOnJobStart ( Jobs . ISchedulerJobRepresentation representation )
39+ {
40+ Console . WriteLine ( "Job started: " + representation . JobClassType . Name ) ;
41+ }
42+
43+ private static void HandlerOnJobFinish ( Jobs . ISchedulerJobRepresentation representation )
44+ {
45+ Console . WriteLine ( "Job finished: " + representation . JobClassType . Name ) ;
46+ }
3347 }
3448}
You can’t perform that action at this time.
0 commit comments