await |
Awaits for completion of the DownloadTask without blocking current thread. Returns DownloadResult or throws corresponding exception if there is any error occurred. suspend fun DownloadTask.await(block: () -> Unit = {}): DownloadResult |
enqueue |
Correspond to DownloadTask.enqueue. This method will create a com.liulishuo.okdownload.DownloadListener instance internally. fun DownloadTask.enqueue(onTaskStart: onTaskStart? = null, onConnectTrialStart: onConnectTrialStart? = null, onConnectTrialEnd: onConnectTrialEnd? = null, onDownloadFromBeginning: onDownloadFromBeginning? = null, onDownloadFromBreakpoint: onDownloadFromBreakpoint? = null, onConnectStart: onConnectStart? = null, onConnectEnd: onConnectEnd? = null, onFetchStart: onFetchStart? = null, onFetchProgress: onFetchProgress? = null, onFetchEnd: onFetchEnd? = null, onTaskEnd: onTaskEnd): Unit |
enqueue1 |
Correspond to DownloadTask.enqueue. This method will create a com.liulishuo.okdownload.core.listener.DownloadListener1 instance internally. fun DownloadTask.enqueue1(taskStart: onTaskStartWithModel? = null, retry: onRetry? = null, connected: onConnected? = null, progress: onProgress? = null, taskEnd: onTaskEndWithModel): Unit |
enqueue2 |
Correspond to DownloadTask.enqueue. This method will create a com.liulishuo.okdownload.core.listener.DownloadListener2 instance internally. fun DownloadTask.enqueue2(onTaskStart: onTaskStart = {}, onTaskEnd: onTaskEnd): Unit |
enqueue3 |
Correspond to DownloadTask.enqueue. This method will create a com.liulishuo.okdownload.core.listener.DownloadListener3 instance internally. fun DownloadTask.enqueue3(onStarted: onStarted? = null, onConnected: onConnected? = null, onProgress: onProgress? = null, onCompleted: onCompleted? = null, onCanceled: onCanceled? = null, onWarn: onWarn? = null, onRetry: onRetry? = null, onError: onError? = null, onTerminal: () -> Unit = {}): Unit |
enqueue4 |
Correspond to DownloadTask.enqueue. This method will create a com.liulishuo.okdownload.core.listener.DownloadListener4 instance internally. fun DownloadTask.enqueue4(onTaskStart: onTaskStart? = null, onConnectStart: onConnectStart? = null, onConnectEnd: onConnectEnd? = null, onInfoReady: onInfoReady? = null, onProgressBlock: onProgressBlock? = null, onProgressWithoutTotalLength: onProgressWithoutTotalLength? = null, onBlockEnd: onBlockEnd? = null, onTaskEndWithListener4Model: onTaskEndWithListener4Model): Unit |
enqueue4WithSpeed |
Correspond to DownloadTask.enqueue. This method will create a com.liulishuo.okdownload.core.listener.DownloadListener4WithSpeed instance internally. fun DownloadTask.enqueue4WithSpeed(onTaskStart: onTaskStart? = null, onConnectStart: onConnectStart? = null, onConnectEnd: onConnectEnd? = null, onInfoReadyWithSpeed: onInfoReadyWithSpeed? = null, onProgressBlockWithSpeed: onProgressBlockWithSpeed? = null, onProgressWithSpeed: onProgressWithSpeed? = null, onBlockEndWithSpeed: onBlockEndWithSpeed? = null, onTaskEndWithSpeed: onTaskEndWithSpeed): Unit |
execute |
Correspond to DownloadTask.execute. This method will create a com.liulishuo.okdownload.DownloadListener instance internally. fun DownloadTask.execute(onTaskStart: onTaskStart? = null, onConnectTrialStart: onConnectTrialStart? = null, onConnectTrialEnd: onConnectTrialEnd? = null, onDownloadFromBeginning: onDownloadFromBeginning? = null, onDownloadFromBreakpoint: onDownloadFromBreakpoint? = null, onConnectStart: onConnectStart? = null, onConnectEnd: onConnectEnd? = null, onFetchStart: onFetchStart? = null, onFetchProgress: onFetchProgress? = null, onFetchEnd: onFetchEnd? = null, onTaskEnd: onTaskEnd): Unit |
execute1 |
Correspond to DownloadTask.execute. This method will create a com.liulishuo.okdownload.core.listener.DownloadListener1 instance internally. fun DownloadTask.execute1(taskStart: onTaskStartWithModel? = null, retry: onRetry? = null, connected: onConnected? = null, progress: onProgress? = null, taskEnd: onTaskEndWithModel): Unit |
execute2 |
Correspond to DownloadTask.execute. This method will create a com.liulishuo.okdownload.core.listener.DownloadListener2 instance internally. fun DownloadTask.execute2(onTaskStart: onTaskStart = {}, onTaskEnd: onTaskEnd): Unit |
execute3 |
Correspond to DownloadTask.execute. This method will create a com.liulishuo.okdownload.core.listener.DownloadListener3 instance internally. fun DownloadTask.execute3(onStarted: onStarted? = null, onConnected: onConnected? = null, onProgress: onProgress? = null, onCompleted: onCompleted? = null, onCanceled: onCanceled? = null, onWarn: onWarn? = null, onRetry: onRetry? = null, onError: onError? = null, onTerminal: () -> Unit = {}): Unit |
execute4 |
Correspond to DownloadTask.execute. This method will create a com.liulishuo.okdownload.core.listener.DownloadListener4 instance internally. fun DownloadTask.execute4(onTaskStart: onTaskStart? = null, onConnectStart: onConnectStart? = null, onConnectEnd: onConnectEnd? = null, onInfoReady: onInfoReady? = null, onProgressBlock: onProgressBlock? = null, onProgressWithoutTotalLength: onProgressWithoutTotalLength? = null, onBlockEnd: onBlockEnd? = null, onTaskEndWithListener4Model: onTaskEndWithListener4Model): Unit |
execute4WithSpeed |
Correspond to DownloadTask.execute. This method will create a com.liulishuo.okdownload.core.listener.DownloadListener4WithSpeed instance internally. fun DownloadTask.execute4WithSpeed(onTaskStart: onTaskStart? = null, onConnectStart: onConnectStart? = null, onConnectEnd: onConnectEnd? = null, onInfoReadyWithSpeed: onInfoReadyWithSpeed? = null, onProgressBlockWithSpeed: onProgressBlockWithSpeed? = null, onProgressWithSpeed: onProgressWithSpeed? = null, onBlockEndWithSpeed: onBlockEndWithSpeed? = null, onTaskEndWithSpeed: onTaskEndWithSpeed): Unit |
spChannel |
This method will create a Channel to represents a single download task's progress. In this way, the DownloadTask is a producer and the returned Channel can be consumed by specific consumer. fun DownloadTask.spChannel(): Channel<DownloadProgress> |