将Coroutine调度员的任务转移到另一个调度员
我的问题很简单,给定调度程序1,如何将调度器1的任务传输到名为Dispatcher 2的另一个调度程序?
My question is simple, given Dispatcher 1, how would you transfer Dispatcher 1's tasks to another Dispatcher named Dispatcher 2?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不确定传输是什么意思,但是是的,您可以在线程之间跳跃。您可以在coroutine内使用
with context
在线程之间切换。像这样:Not sure what transfer would mean but yes you can jump between threads. You can use
withContext
within a coroutine to switch between threads. Like so: