How to create Windows service to schedule task with Topshelf and FluentScheduler- Part 2

Akshaykumar
1 min readFeb 18, 2021

In previous part, we saw that how we can easily create Windows service. In this part, we will look how we can run parallel jobs by the help of FluentScheduler.

Let’s add the FluentScheduler from nuget package.

Add a class FirstScheduleRegistry that inherits the Registry provided by FluentScheduler.

Add one more class similar to above one named as SecondScheduleRegistry . Just to see how we can run two jobs parallelly.

NonReentrant doesn’t allows a schedule to run in parallel with a previously triggered execution of the same schedule.

ToRunNow to run the job without any delay.

Now we need to initiate these jobs from DemoService.cs

Both the jobs will run in parallel. Now we can install this Windows service as we discussed in the previous part.

Creating a Windows service with multiple scheduled job is no logger a cumbersome task.

--

--

Akshaykumar

web developer. Love to work with .Net technologies.