Skip to content

Commit

Permalink
Test something
Browse files Browse the repository at this point in the history
Signed-off-by: Fredy Wijaya <[email protected]>
  • Loading branch information
fredyw committed Jul 18, 2024
1 parent d7faafd commit b400631
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions mobile/examples/swift/async_await/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,11 @@ struct ContentView: View {
.streamClient()

writeLog("Dispatching requests")
for index in 0..<3 {
await streamClient.postToHTTPBin(data: data, logger: { log in
Task.detached {
await writeLog("[\(index)] \(log)")
}
})
}
await streamClient.postToHTTPBin(data: data, logger: { log in
Task.detached {
await writeLog("[\(index)] \(log)")
}
})
}
}

Expand Down Expand Up @@ -106,8 +104,8 @@ private extension StreamClient {
let headers = RequestHeadersBuilder(method: .post, scheme: "https",
authority: "httpbin.org", path: "/post")
.build()
stream.sendHeaders(headers, endStream: false)
stream.close(data: data)
stream.sendHeaders(headers, endStream: true)
// stream.close(data: data)
logger("Finished scheduling upload")
}
}
Expand Down

0 comments on commit b400631

Please sign in to comment.