class DownloadHandle
future
: CompletableFuture
[Get] |
Future that completes with the validated File on success, or completes exceptionally with PakDownloadException on failure.
Signature
val future: CompletableFuture<File> |
isCancelled
: Boolean
[Get] |
Signature
val isCancelled: Boolean |
isTerminated
: Boolean
[Get] |
True once the handle has reached a terminal state (Ready or Failed).
Signature
val isTerminated: Boolean |
onStateChanged
: Function1?
[Get][Set] |
Optional listener for state changes. Called on an unspecified background thread.
Note: the initial Idle -> Downloading transition fires synchronously inside PakDownloadManager.start before this handle is returned, so it cannot be observed via this listener — read DownloadHandle.state directly after start if you need the initial state.
Signature
var onStateChanged: (DownloadState) -> Unit? |
request
: DownloadRequest
[Get] |
Signature
val request: DownloadRequest |
state
: DownloadState
[Get] |
Signature
var state: DownloadState |
cancel
()
|
Request cancellation. Idempotent. Transitions to Failed(Cancelled) if still in progress.
Signature
fun cancel() |