IThreadPool Interface

Quartz.NET 3.0 API Documentation
The interface to be implemented by classes that want to provide a thread pool for the IScheduler's use.

Namespace:  Quartz.Spi
Assembly:  Quartz (in Quartz.dll) Version: 3.0.0
Syntax

C#
public interface IThreadPool

The IThreadPool type exposes the following members.

Properties

  NameDescription
Public propertyInstanceId
Inform the IThreadPool of the Scheduler instance's Id, prior to initialize being invoked.
Public propertyInstanceName
Inform the IThreadPool of the Scheduler instance's name, prior to initialize being invoked.
Public propertyPoolSize
Get the current number of threads in the IThreadPool.
Top
Methods

  NameDescription
Public methodBlockForAvailableThreads
Determines the number of threads that are currently available in the pool. Useful for determining the number of times RunInThread(FuncTask) can be called before returning false.
Public methodInitialize
Must be called before the thread pool is used, in order to give the it a chance to Initialize.
Public methodRunInThread
Execute the given Task in the next available Thread.
Public methodShutdown
Called by the QuartzScheduler to inform the thread pool that it should free up all of it's resources because the scheduler is shutting down.
Top
Remarks

IThreadPool implementation instances should ideally be made for the sole use of Quartz. Most importantly, when the method BlockForAvailableThreads returns a value of 1 or greater, there must still be at least one available thread in the pool when the method RunInThread(FuncTask) is called a few moments (or many moments) later. If this assumption does not hold true, it may result in extra JobStore queries and updates, and if clustering features are being used, it may result in greater imbalance of load.
See Also

Reference