Interface ISchedulerRepository
- Namespace
- Quartz.Extensibility
- Assembly
- Quartz.dll
Holds references to Scheduler instances - ensuring uniqueness, and preventing garbage collection, and allowing 'global' lookups.
public interface ISchedulerRepository
Remarks
Schedulers are indexed by name. Multiple schedulers with the same name but different instance IDs can coexist (e.g., remote proxies to different cluster nodes). Pass an instance ID to Lookup(string, string?) to disambiguate between them.
Methods
Bind(IScheduler, string?)
Binds a scheduler to the registry.
void Bind(IScheduler scheduler, string? instanceId = null)
Parameters
schedulerISchedulerThe scheduler to bind.
instanceIdstringThe instance ID to index the scheduler under. When null, SchedulerInstanceId supplies it; pass it explicitly for a remote scheduler, where reading that property may cost a network call.
Lookup(string, string?)
Looks up a scheduler by name, and by instance ID when one is given.
IScheduler? Lookup(string schedulerName, string? instanceId = null)
Parameters
schedulerNamestringThe name of the scheduler to look up.
instanceIdstringThe instance ID to disambiguate by. When null, the first scheduler registered under the name is returned.
Returns
LookupAll()
Returns all registered schedulers.
List<IScheduler> LookupAll()
Returns
LookupByName(string)
Returns all schedulers with the given name.
List<IScheduler> LookupByName(string schedulerName)
Parameters
schedulerNamestring
Returns
Remove(string, string?)
Removes a scheduler from the registry.
bool Remove(string schedulerName, string? instanceId = null)
Parameters
schedulerNamestringThe name of the scheduler to remove.
instanceIdstringThe instance ID of the scheduler to remove. When null, the first scheduler registered under the name is removed.