admin管理员组文章数量:1222241
I'm implementing a background worker that uploads a set of files to my backend. I'm using WorkManager for this, combined with ktor to do the network requests.
Now recently I've noticed that ListenableWorker has a getNetwork()
method (transformed to just network
in Kotlin), which returns an android.Network
.
Really the only mention of this method I've found is this snippet from WorkManager's release notes for version 2.9:
Add support for
JobParameters#getNetwork()
on API 28. This is exposed viaWorker.getNetwork()
.
JobParameters#getNetwork()
links to some documentation stating the following:
Return the network that should be used to perform any network requests for this job.
My question is simply what I am supposed to do with this network. Should I be using it to do my requests instead of my ktor client? Can I hook up said client to use this network somehow? Right now I'm just injecting the client into the worker using Hilt.
Thanks.
本文标签: androidWhat am I meant to do with ListenableWorkergetNetwork()Stack Overflow
版权声明:本文标题:android - What am I meant to do with ListenableWorker::getNetwork()? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1739379761a2160650.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论