ScrapingTask<T> class

A task for scraping operations

Constructors

ScrapingTask({required String id, required String domain, required String url, required Future<T> execute(), TaskPriority priority = TaskPriority.normal, int maxRetries = 3, List<ScrapingTask> dependencies = const [], Logger? logger, DateTime? createdAt})
Creates a new ScrapingTask

Properties

areDependenciesComplete → bool
Gets whether this task's dependencies are complete
no setter
canExecute → bool
Gets whether this task can be executed
no setter
completedAt ↔ DateTime?
The time when the task was completed
getter/setter pair
createdAt → DateTime
The time when the task was created
final
dependencies → List<ScrapingTask>
The dependencies of this task
final
domain → String
The domain this task is associated with
final
error ↔ dynamic
The error that occurred during execution, if any
getter/setter pair
execute → Future<T> Function()
The function to execute for this task
final
future → Future<T>
Gets the future for this task
no setter
hashCode → int
The hash code for this object.
no setterinherited
id → String
Unique identifier for the task
final
isComplete → bool
Gets whether this task is complete
no setter
logger → Logger?
Logger for logging operations
final
maxRetries → int
The maximum number of retry attempts
final
priority → TaskPriority
The priority of the task
final
processed → bool
Gets whether this task has been processed
no setter
result ↔ T?
The result of the task
getter/setter pair
retryCount ↔ int
The current retry count
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stackTrace ↔ StackTrace?
The stack trace of the error, if any
getter/setter pair
startedAt ↔ DateTime?
The time when the task was started
getter/setter pair
status ↔ TaskStatus
The current status of the task
getter/setter pair
url → String
The URL to scrape
final

Methods

cancel() → void
Cancels the task
markAsProcessed() → void
Sets the task as processed
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run() → Future<T>
Executes the task
toString() → String
A string representation of this object.
override

Operators

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