TaskScheduler class

A scheduler for managing concurrent scraping tasks

Constructors

TaskScheduler.new({required RateLimiter rateLimiter, required ResourceMonitor resourceMonitor, TaskSchedulerConfig config = const TaskSchedulerConfig(), Logger? logger})
Creates a new TaskScheduler

Properties

config TaskSchedulerConfig
The configuration for the scheduler
final
currentConcurrencyLevel int
Gets the current concurrency level
no setter
executingTaskCount int
Gets the number of executing tasks
no setter
hashCode int
The hash code for this object.
no setterinherited
isRunning bool
Gets whether the scheduler is running
no setter
logger Logger?
Logger for logging operations
final
queuedTaskCount int
Gets the number of queued tasks
no setter
rateLimiter RateLimiter
The rate limiter to use for domain-specific rate limiting
final
resourceMonitor ResourceMonitor
The resource monitor to use for adaptive concurrency
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
totalTaskCount int
Gets the total number of tasks
no setter

Methods

cancel(String taskId) → void
Cancels a task
cancelAll() → void
Cancels all tasks
enqueue<T>(ScrapingTask<T> task) Future<T>
Enqueues a task
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
start() → void
Starts the scheduler
stop() → void
Stops the scheduler
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited