index.md 3.6 KB

net / com.drake.net.scope / NetCoroutineScope

NetCoroutineScope

open class NetCoroutineScope :AndroidScope

自动显示网络错误信息协程作用域

Constructors

Name Summary
<init> NetCoroutineScope(lifecycleOwner: LifecycleOwner, lifeEvent: Event = Lifecycle.Event.ON_DESTROY)
自动显示网络错误信息协程作用域NetCoroutineScope()

Properties

Name Summary
animate var animate:Boolean
error var error:Boolean
isCacheSucceed var isCacheSucceed:Boolean
isReadCache var isReadCache:Boolean
onCache var onCache: (suspend CoroutineScope.() ->Unit)?

Functions

Name Summary
cache 该函数一般用于缓存读取 只在第一次启动作用域时回调 该函数在作用域launch之前执行 函数内部所有的异常都不会被抛出, 也不会终止作用域执行fun cache(error:Boolean= false, animate:Boolean= false, onCache: suspend CoroutineScope.() ->Unit):AndroidScope
cancel open fun cancel(cause: CancellationException?):Unit
catch open fun catch(e:Throwable):Unit
finally open fun finally(e:Throwable?):Unit
handleError 错误处理open fun handleError(e:Throwable):Unit
launch open fun launch(block: suspend CoroutineScope.() ->Unit):NetCoroutineScope
readCache 读取缓存回调open fun readCache(succeed:Boolean):Unit

Inheritors

Name Summary
DialogCoroutineScope 自动加载对话框网络请求class DialogCoroutineScope :NetCoroutineScope, LifecycleObserver
PageCoroutineScope class PageCoroutineScope :NetCoroutineScope
StateCoroutineScope 缺省页作用域class StateCoroutineScope :NetCoroutineScope