drake %!s(int64=2) %!d(string=hai) anos
pai
achega
2c429d8e82
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      docs/coroutine-request.md

+ 3 - 1
docs/coroutine-request.md

@@ -12,7 +12,9 @@ Net在2.0开始引入协程来支持并发和异步, 虽然很多网络框架支
 val job = scopeNetLife {
     repeat(10000) {
         // 这里将返回的数据显示在TextView上
-        tvFragment.text = Get<String>("https://github.com/liangjingkanji/Net/").await()
+        launch {
+            tvFragment.text = Get<String>("https://github.com/liangjingkanji/Net/").await()
+        }
     }
 }
 ```