c \ # 작업 스케줄 링 편 QuartZ (세 번 째 부분: 관리 시각 화 실현)
5790 단어 . Net 유 니 버 설 도구
원래 항목 코드
#region Scheduler
//StdSchedulerFactory factory = new StdSchedulerFactory();
//IScheduler scheduler = await factory.GetScheduler();
IScheduler scheduler = await ScheduleManager.BuildScheduler();
await scheduler.Start();
#endregion
스케줄 관리자 클래스
public class ScheduleManager
{
public async static Task<IScheduler> BuildScheduler()
{
var properties = new NameValueCollection();
properties["quartz.scheduler.instanceName"] = " ";
//
properties["quartz.threadPool.type"] = "Quartz.Simpl.SimpleThreadPool, Quartz";
properties["quartz.threadPool.threadCount"] = "5";
properties["quartz.threadPool.threadPriority"] = "Normal";
//
properties["quartz.scheduler.exporter.type"] = "Quartz.Simpl.RemotingSchedulerExporter, Quartz";
properties["quartz.scheduler.exporter.port"] = "8008";//
properties["quartz.scheduler.exporter.bindName"] = "QuartzScheduler";
properties["quartz.scheduler.exporter.channelType"] = "tcp";
var schedulerFactory = new StdSchedulerFactory(properties);
IScheduler _scheduler = await schedulerFactory.GetScheduler();
return _scheduler;
}
}