本文整理汇总了C#中IScheduler类的典型用法代码示例。如果您正苦于以下问题:C# IScheduler类的具体用法?C# IScheduler怎么用?C# IScheduler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IScheduler类属于命名空间,在下文中一共展示了IScheduler类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: QuartzService
public QuartzService()
{
InitializeComponent();
logger = LogManager.GetLogger(GetType());
ISchedulerFactory schedulerFactory = new StdSchedulerFactory();
scheduler = schedulerFactory.GetScheduler();
}
开发者ID:modulexcite,项目名称:Quartz.net.James,代码行数:7,代码来源:QuartzService.cs
示例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();
}
开发者ID:ItsJustSean,项目名称:TailBlazer,代码行数:35,代码来源:FileInfoEx.cs
示例3: RepoWatcher
public RepoWatcher(IGithubBrowser browser, Repo repoToWatch, IScheduler backgroundScheduler)
{
_timerDisposal = Observable
.Interval(_defaultRefreshSpan, backgroundScheduler)
.SelectMany(_ => browser.GetCommits(repoToWatch))
.Subscribe(OnCommitsArrived);
}
开发者ID:pgdotnet,项目名称:RxWorkshop,代码行数:7,代码来源:RepoWatcher.cs
示例4: FaxMessageService
public FaxMessageService(IMessaggisticaService messaggisticaService, IScheduler scheduler, IConfigurationMessageService configurationService, IDaoFactory daoFactory)
{
_messaggisticaService = messaggisticaService;
_scheduler = scheduler;
_configurationService = configurationService;
_daoFactory = daoFactory;
}
开发者ID:gipasoft,项目名称:Sfera,代码行数:7,代码来源:FaxMessageService.cs
示例5: TestBlobCache
internal TestBlobCache(Action disposer,
IScheduler scheduler,
IEnumerable<KeyValuePair<string, byte[]>> initialContents)
: this(scheduler, initialContents)
{
inner = Disposable.Create(disposer);
}
开发者ID:ThomasLebrun,项目名称:Akavache,代码行数:7,代码来源:TestBlobCache.cs
示例6: NotifyPropertyChangedBase
public NotifyPropertyChangedBase(IScheduler scheduler) {
if (scheduler != null) {
this.scheduler = scheduler;
} else {
this.scheduler = Scheduler.Immediate;
}
}
开发者ID:zzilla,项目名称:ONVIF-Device-Manager,代码行数:7,代码来源:NotifyPropertyChangedBase.cs
示例7: LinkSpiderPipeline
public LinkSpiderPipeline(string entityName, IScheduler nextSpiderScheduler, ISpider nextSpider, LinkSpiderPrepareStartUrls prepareStartUrls)
{
NextSpiderScheduler = nextSpiderScheduler;
NextSpider = nextSpider;
_prepareStartUrls = prepareStartUrls;
_entityName = entityName;
}
开发者ID:yalunwang,项目名称:DotnetSpider,代码行数:7,代码来源:LinkSpiderPipeline.cs
示例8: DefaultKayakSocket
internal DefaultKayakSocket(Socket socket, IScheduler scheduler)
{
this.id = nextId++;
this.socket = new SocketWrapper(socket);
this.scheduler = scheduler;
state = new KayakSocketState(false);
}
开发者ID:paulecoyote,项目名称:kayak,代码行数:7,代码来源:KayakSocket.cs
示例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);
}
}
开发者ID:shentianyi,项目名称:ifDataHouse,代码行数:31,代码来源:QmailRunner.cs
示例10: RemoveScheduler
public void RemoveScheduler(IScheduler scheduler)
{
lock (_listLock)
{
_scheduleList.Remove(scheduler);
}
}
开发者ID:soshimozi,项目名称:Cron-Plugin-Service,代码行数:7,代码来源:SchedulerManager.cs
示例11: AddScheduler
public void AddScheduler(IScheduler scheduler)
{
lock (_listLock)
{
_scheduleList.Add(scheduler);
}
}
开发者ID:soshimozi,项目名称:Cron-Plugin-Service,代码行数:7,代码来源:SchedulerManager.cs
示例12: TaskPool
static TaskPool()
{
_taskpool = new TaskPool();
ISchedulerFactory sf = new StdSchedulerFactory();
_ische = sf.GetScheduler();
_ische.Start();
}
开发者ID:zwc00zwc,项目名称:TaskManager,代码行数:7,代码来源:TaskPool.cs
示例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);
}
开发者ID:gsbastian,项目名称:Sriracha.Deploy,代码行数:7,代码来源:JobScheduler.cs
示例14: TaskCoordinator
public TaskCoordinator(IScheduler scheduler, Logger logger)
{
_logger = logger;
_scheduler = scheduler;
_logger.Info("TaskCoordincator started with scheduler: {0}", scheduler.SchedulerInstanceId);
}
开发者ID:mamluka,项目名称:SpeedyMailer,代码行数:7,代码来源:TaskCoordinator.cs
示例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);
}
}
开发者ID:erichexter,项目名称:HomeAutomation,代码行数:12,代码来源:X10AgentService.cs
示例16: ThreadWorker
public ThreadWorker (IScheduler sched, ThreadWorker[] others, IProducerConsumerCollection<Task> sharedWorkQueue,
bool createThread, int maxStackSize, ThreadPriority priority, EventWaitHandle handle)
{
this.others = others;
this.dDeque = new CyclicDeque<Task> ();
this.sharedWorkQueue = sharedWorkQueue;
this.workerLength = others.Length;
this.isLocal = !createThread;
this.waitHandle = handle;
this.childWorkAdder = delegate (Task t) {
dDeque.PushBottom (t);
sched.PulseAll ();
};
// Find the stealing start index randomly (then the traversal
// will be done in Round-Robin fashion)
do {
this.stealingStart = r.Next(0, workerLength);
} while (others[stealingStart] == this);
InitializeUnderlyingThread (maxStackSize, priority);
}
开发者ID:stabbylambda,项目名称:mono,代码行数:25,代码来源:ThreadWorker.cs
示例17: SetUp
public void SetUp()
{
_collector = Substitute.For<IItemCollector>();
_scheduler = Substitute.For<IScheduler>();
_loginModel = Substitute.For<ILoginModel>();
_uut = new ScheduledShoppingListModel(_collector, _scheduler, _loginModel);
}
开发者ID:JakobVork,项目名称:Semesterprojekt4,代码行数:7,代码来源:ScheduledShoppingListModelUnitTest.cs
示例18: ThreadWorker
public ThreadWorker (IScheduler sched, ThreadWorker[] others, IProducerConsumerCollection<Task> sharedWorkQueue,
bool createThread, int maxStackSize, ThreadPriority priority)
{
this.others = others;
// if (!string.IsNullOrEmpty (Environment.GetEnvironmentVariable ("USE_CYCLIC"))) {
// Console.WriteLine ("Using cyclic deque");
// this.dDeque = new CyclicDeque<Task> ();
// } else {
// this.dDeque = new DynamicDeque<Task> ();
// }
this.dDeque = new CyclicDeque<Task> ();
this.sharedWorkQueue = sharedWorkQueue;
this.workerLength = others.Length;
this.isLocal = !createThread;
this.childWorkAdder = delegate (Task t) {
dDeque.PushBottom (t);
sched.PulseAll ();
};
// Find the stealing start index randomly (then the traversal
// will be done in Round-Robin fashion)
do {
this.stealingStart = r.Next(0, workerLength);
} while (others[stealingStart] == this);
InitializeUnderlyingThread (maxStackSize, priority);
}
开发者ID:runefs,项目名称:Marvin,代码行数:30,代码来源:ThreadWorker.cs
示例19: NotificationService
public NotificationService(
PhoneApplicationFrame RootFrame,
[Dispatcher] IScheduler Dispatcher
) {
RootFrame.Navigated += OnFrameNavigated;
NotificationScheduler = Dispatcher;
}
开发者ID:rollingthunder,项目名称:DiversityMobile,代码行数:7,代码来源:NotificationService.cs
示例20: ScheduleJob
private static void ScheduleJob(IScheduler scheduler)
{
const int INTERVAL_IN_SECONDS = 5;
scheduler.ScheduleJob(
JobBuilder.Create<YhdArchiveJob>().WithIdentity("YhdArchiveJob").Build(),
TriggerBuilder.Create().WithIdentity("YhdArchiveTrigger").StartNow().WithSimpleSchedule(x => x.RepeatForever().WithIntervalInSeconds(INTERVAL_IN_SECONDS)).Build());
}
开发者ID:keily,项目名称:LightOne,代码行数:7,代码来源:Program.cs
注:本文中的IScheduler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论