fluentscheduler asp.net example

public class Demo : Registry{    public Demo()    {        // Schedule an IJob to run at an interval        // Perform scheduled tasks every two seconds immediately. (Specify a time interval to run, according to your needs, can be seconds, minutes, hours, days, months, years, etc.)        Schedule<MyJob>().ToRunNow().AndEvery(2).Seconds();         // Schedule an IJob to run once, delayed by a specific time interval        // Delay the execution of a scheduled task at a specified interval. (Of course, this interval can still be seconds, minutes, hours, days, months, years, etc.)        Schedule<MyJob>().ToRunOnceIn(5).Seconds();         // Schedule a simple job to run at a specific time        // Perform scheduled tasks at a specified time (most commonly. This is performed every day at 1:10 pm)        Schedule(() => Trace.WriteLine("It's 1:10 PM now.")).ToRunEvery(1).Days().At(13, 10);        Schedule(() => {            // Do what you want to do.            Trace.WriteLine("It's 1:10 PM now.");        }).ToRunEvery(1).Days().At(13, 10);        // Schedule a more complex action to run immediately and on an monthly interval        // Immediately execute a scheduled task on Monday, 3:00 pm (you can see the time of this more complicated point, it means it can do it too!)        Schedule<MyComplexJob>().ToRunNow().AndEvery(1).Months().OnTheFirst(DayOfWeek.Monday).At(3, 0);        // Schedule multiple jobs to be run in a single schedule        // Perform two (multiple) tasks in the same plan        Schedule<MyJob>().AndThen<MyOtherJob>().ToRunNow().AndEvery(5).Minutes();    }}public class MyJob : IJob{    void IJob.Execute()    {        Trace.WriteLine("The time is now:" +DateTime.Now);    }}public class MyOtherJob : IJob{    void IJob.Execute()    {        Trace.WriteLine("This is another Job, now the time is:" + DateTime.Now);    }}public class MyComplexJob : IJob{    void IJob.Execute()    {        Trace.WriteLine("This is a more complicated job, now the time is:" + DateTime.Now);    }}

Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source