Quartz.net Quick Start First lesson (official website document translation)

Source: Internet
Author: User

Quartz.net Quick Start First lesson (official website document translation)

Original link

before you use the dispatcher (Scheduler), you need to instantiate it (who can guess this?). )。 When instantiating scheduler, you need to use ischedulerfactory.

After you instantiate the good scheduler. You can start, leave it in wait mode, and turn it off. Please note: Once the scheduler is closed, it will no longer be restarted. Unless you're instantiating a new scheduler. If the scheduler is not started (Triggers) (the code in the Ijob instance object is not executed), the trigger remains in the wait state

1     //construct a scheduler factory2Ischedulerfactory schedfact =Newstdschedulerfactory ();3     4     //Get a scheduler5IScheduler sched =Schedfact.getscheduler ();6 Sched. Start ();7     8     //define the job and tie it to our Hellojob class9Ijobdetail job = jobbuilder.create()Ten. Withidentity ("MyJob","group1") One         . Build (); A    -    //Trigger the job to run now, and then every seconds -Itrigger trigger =triggerbuilder.create () the. Withidentity ("Mytrigger","group1") -       . Startnow () -. Withsimpleschedule (x =x -. Withintervalinseconds ( +) +           . RepeatForever ()) -       . Build (); +        ASched. Schedulejob (Job, trigger);

As shown in the code above, let quartz.net work to be simple. In the next section, we'll give a quick preview of jobs and triggers, so you'll have a clearer understanding of the code above.

Quartz.net Quick Start First lesson (official website document translation)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.