public static void AddQueue(this IServiceCollection services) { Scheduler scheduler = SchedulerHost.GetSchedulerInstance(); IQueue queue = scheduler.UseQueue(); services.AddSingleton <IQueue>(queue); }
protected override void LazyInit() { NameValueCollection properties = null; try { var hosts = SchedulerHost.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); foreach (var host in hosts) { properties = GetSchedulerProperties(); properties["quartz.scheduler.proxy.address"] = host; ISchedulerFactory schedulerFactory = new StdSchedulerFactory(properties); _scheduler.Add(schedulerFactory.GetScheduler()); InitScheduler(_scheduler); } } catch (Exception ex) { throw new SchedulerProviderException("Could not initialize scheduler", ex, properties); } if (_scheduler == null || _scheduler.Count == 0) { throw new SchedulerProviderException( "Could not initialize scheduler", properties); } }
public SchedulerHostStub(params GroupStub[] groups) { Groups = new List <GroupStub>(groups); SchedulerCommander = new SchedulerCommanderStub(Groups); SchedulerClerk = new SchedulerClerkStub(Groups); Value = new SchedulerHost(SchedulerClerk, SchedulerCommander, new Version(1, 0, 0, 0), null, null); }
public static IHostedScheduler AddScheduler(this IServiceCollection services, Action <IScheduler> configScheduledTasks) { Scheduler scheduler = SchedulerHost.GetSchedulerInstance(); services.AddHostedService <SchedulerHost>(); configScheduledTasks(scheduler); return(scheduler); }
public SubstitutableSchedulerHost() { SchedulerCommander = Substitute.For <ISchedulerCommander>(); Value = new SchedulerHost( Substitute.For <ISchedulerClerk>(), SchedulerCommander, new Version(), Substitute.For <ISchedulerEventHub>(), Substitute.For <ISchedulerEventTarget>()); }
public SchedulerHostStub(Type[] allowedJobTypes, params GroupStub[] groups) { Groups = new List <GroupStub>(groups); SchedulerCommander = new SchedulerCommanderStub(Groups); SchedulerClerk = new SchedulerClerkStub(Groups); Value = new SchedulerHost( SchedulerClerk, SchedulerCommander, new Version(1, 0, 0, 0), null, null, new AllowedJobTypesRegistryStub(allowedJobTypes)); }
private SchedulerHost AssignErrorHost(string primaryError, Version version = null, Exception exception = null) { _schedulerHost = new SchedulerHost(version, new[] { primaryError }.Concat(GetExceptionMessages(exception)).ToArray()); return(_schedulerHost); }
protected void RiseEvent(RawSchedulerEvent @event) { SchedulerHost.RaiseEvent(@event); }