FluentScheduler icon indicating copy to clipboard operation
FluentScheduler copied to clipboard

InitializeWithoutStarting with RunNow

Open nickone220590 opened this issue 8 years ago • 6 comments

var reg = new Registry();
reg.Schedule(() => Console.WriteLine(123));
JobManager.InitializeWithoutStarting(reg);
Console.ReadLine();

When start app Schedule all the same, action

nickone220590 avatar Sep 14 '17 09:09 nickone220590

Where can read detailed documentation about InitializeWithoutStarting

nickone220590 avatar Sep 14 '17 09:09 nickone220590

Well, there is not such information on the library documentation. Do you have any specific issue involving this method? Obs: (I believe It will be soon added to documentation)

@tallesl

VitorCioletti avatar Sep 26 '17 21:09 VitorCioletti

There's not much to say other than what is already stated on the XML-docs (IntelliSense).

Initialize:

Initializes the job manager with the jobs to run and starts it.

InitializeWithoutStarting:

Initializes the job manager with the jobs without starting it.

One starts right away and the other doesn't, you have to call Start yourself.

tallesl avatar Sep 27 '17 01:09 tallesl

For me, both Initialize and InitializeWithoutStarting starts the job immediately.

I had hoped that my jobs will not start unless I call JobManager.Start() in case of InitializeWithoutStarting.

goforgold avatar Jun 03 '20 14:06 goforgold

Decided to test a bit further, there's definitely a bug with InitializeWithoutStarting.

This doesn't start the job as expected:

registry = new Registry();
Schedule(() => Console.WriteLine("hello")).ToRunEvery(1).Seconds();
JobManager.InitializeWithoutStarting(registry);

But this starts:

 registry = new Registry();
Schedule(() => Console.WriteLine("hello")).ToRunNow();
JobManager.InitializeWithoutStarting(registry);

Reopening and flagging as a bug.

tallesl avatar Aug 02 '20 01:08 tallesl

As a side note, I ask myself what's the utility of InitializeWithoutStarting.

tallesl avatar Aug 02 '20 01:08 tallesl