本文整理汇总了C#中IScheduler类的典型用法代码示例。如果您正苦于以下问题:C# IScheduler类的具体用法?C# IScheduler怎么用?C# IScheduler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IScheduler类属于命名空间,在下文中一共展示了IScheduler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QuartzService
public QuartzService()
{
InitializeComponent();
logger = LogManager.GetLogger(GetType());
ISchedulerFactory schedulerFactory = new StdSchedulerFactory();
scheduler = schedulerFactory.GetScheduler();
}
示例2: WatchFile
/// <summary>
/// A simpler alternative to the irritatingly useless FileSystemWatcher
/// </summary>
/// <param name="file">The file to monitor</param>
/// <param name="refreshPeriod">The refresh period.</param>
/// <param name="scheduler">The scheduler.</param>
/// <returns></returns>
public static IObservable<FileNotification> WatchFile(this FileInfo file, TimeSpan? refreshPeriod = null,
IScheduler scheduler = null)
{
return Observable.Create<FileNotification>(observer =>
{
var refresh = refreshPeriod ?? TimeSpan.FromMilliseconds(250);
scheduler = scheduler ?? Scheduler.Default;
FileNotification notification = null;
return scheduler.ScheduleRecurringAction(refresh, () =>
{
try
{
notification = notification == null
? new FileNotification(file)
: new FileNotification(notification);
observer.OnNext(notification);
}
catch (Exception ex)
{
notification = new FileNotification(file, ex);
observer.OnNext(notification);
}
});
}).DistinctUntilChanged();
}
示例3: RepoWatcher
public RepoWatcher(IGithubBrowser browser, Repo repoToWatch, IScheduler backgroundScheduler)
{
_timerDisposal = Observable
.Interval(_defaultRefreshSpan, backgroundScheduler)
.SelectMany(_ => browser.GetCommits(repoToWatch))
.Subscribe(OnCommitsArrived);
}
示例4: FaxMessageService
public FaxMessageService(IMessaggisticaService messaggisticaService, IScheduler scheduler, IConfigurationMessageService configurationService, IDaoFactory daoFactory)
{
_messaggisticaService = messaggisticaService;
_scheduler = scheduler;
_configurationService = configurationService;
_daoFactory = daoFactory;
}
示例5: TestBlobCache
internal TestBlobCache(Action disposer,
IScheduler scheduler,
IEnumerable<KeyValuePair<string, byte[]>> initialContents)
: this(scheduler, initialContents)
{
inner = Disposable.Create(disposer);
}
示例6: NotifyPropertyChangedBase
public NotifyPropertyChangedBase(IScheduler scheduler) {
if (scheduler != null) {
this.scheduler = scheduler;
} else {
this.scheduler = Scheduler.Immediate;
}
}
示例7: LinkSpiderPipeline
public LinkSpiderPipeline(string entityName, IScheduler nextSpiderScheduler, ISpider nextSpider, LinkSpiderPrepareStartUrls prepareStartUrls)
{
NextSpiderScheduler = nextSpiderScheduler;
NextSpider = nextSpider;
_prepareStartUrls = prepareStartUrls;
_entityName = entityName;
}
示例8: DefaultKayakSocket
internal DefaultKayakSocket(Socket socket, IScheduler scheduler)
{
this.id = nextId++;
this.socket = new SocketWrapper(socket);
this.scheduler = scheduler;
state = new KayakSocketState(false);
}
示例9: Main
static void Main(string[] args)
{
try
{
Console.Title = "QMail";
Console.ForegroundColor = ConsoleColor.White;
ISchedulerFactory sf = new StdSchedulerFactory();
Scheduler = sf.GetScheduler();
new TskInspectDetailJobTrigger();
Scheduler.Start();
for (var i = 0; i < 10; i++) {
Console.WriteLine();
}
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine(" ---------------------------------------------------");
Console.WriteLine(" ...................QMail已启动......................");
Console.WriteLine(" ...................请不要关闭此窗口.................");
Console.WriteLine(" ---------------------------------------------------");
for (var i = 0; i < 10; i++)
{
Console.WriteLine();
}
Console.ReadLine();
}
catch (Exception e) {
LogUtil.Logger.Error(e.Message);
}
}
示例10: RemoveScheduler
public void RemoveScheduler(IScheduler scheduler)
{
lock (_listLock)
{
_scheduleList.Remove(scheduler);
}
}
示例11: AddScheduler
public void AddScheduler(IScheduler scheduler)
{
lock (_listLock)
{
_scheduleList.Add(scheduler);
}
}
示例12: TaskPool
static TaskPool()
{
_taskpool = new TaskPool();
ISchedulerFactory sf = new StdSchedulerFactory();
_ische = sf.GetScheduler();
_ische.Start();
}
示例13: JobScheduler
public JobScheduler(IScheduler quartzScheduler, Logger logger, ISystemSettings systemSettings)
{
this._quartzScheduler = DIHelper.VerifyParameter(quartzScheduler);
this._logger = DIHelper.VerifyParameter(logger);
this._systemSettings = DIHelper.VerifyParameter(systemSettings);
}
示例14: TaskCoordinator
public TaskCoordinator(IScheduler scheduler, Logger logger)
{
_logger = logger;
_scheduler = scheduler;
_logger.Info("TaskCoordincator started with scheduler: {0}", scheduler.SchedulerInstanceId);
}
示例15: ConfigureScheduledEvents
//public void Echo(string message)
//{
// Console.WriteLine(message);
// hubProxy.Invoke("commandSent", string.Empty, message);
//}
private static void ConfigureScheduledEvents(IScheduler sched)
{
foreach (var trigger in GetTriggers())
{
sched.ScheduleJob(JobBuilder.Create<PublishEvent>().Build(), trigger);
}
}