DownloadPool class

Constructors

DownloadPool({int poolSize = MAX_POOL_SIZE})
Constructs a DownloadPool with the specified poolSize. Throws an ArgumentError if the pool size is less than or equal to zero.

Properties

downloadingTasks List<DownloadTask>
Returns the list of tasks that are currently downloading.
no setter
hashCode int
The hash code for this object.
no setterinherited
prepareTasks List<DownloadTask>
Returns the list of tasks that are not currently downloading.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
streamController StreamController<DownloadTask>
Returns the stream controller for task updates.
no setter
taskList List<DownloadTask>
Returns the list of all tasks in the pool.
no setter

Methods

addTask(DownloadTask task) Future<DownloadTask>
Adds a new task to the pool, creating a cache directory if needed.
dispose() → void
executeTask(DownloadTask task) Future<DownloadTask>
Executes a task, replacing any existing lower-priority task with the same cache key. Schedules the isolate pool for task execution.
findTaskById(String taskId) DownloadTask?
Finds a task in the pool by its taskId.
findTaskByUrl(String url) DownloadTask?
Finds a task in the pool by its url.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
roundTask() Future<void>
Schedules the pool to run tasks, ensuring only one thread runs this logic at a time.
toString() String
A string representation of this object.
inherited
updateTaskById(String taskId, DownloadStatus status) → void
updateTaskByUrl(String url, DownloadStatus status) → void

Operators

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