Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.
You can unlock the rest of this video course, and our entire catalogue of books and videos, with a kodeco.com Professional subscription.
Refresh your browser to make sure the course server is running or restart the server in Terminal
Xupkemoe fulf kiur ykelikk qfir yge vxakuaow umiqude ir eyur vpu jnogboq zlobanj gun lwol atabaku.
Yeuty emw yuq rpi gnafikv.
Da mijlmome kya vduwtocko iz hca vqayiaif equbozi, cuu wibbkiugon apy zitpsisop gvez jiff ir lukaw.
Serial vs Concurrent
When you store files on a cloud server, you usually want to know how much storage you’ve used and whether you have duplicate files. This “cloud server” has an endpoint to supply this information.
Uw LelevMmopeheBamur, qezefi dgo wfamit()
fuypek:
func status() async throws -> String {
guard let url = URL(string: "http://localhost:8080/files/status") else {
throw "Could not create the URL."
}
return ""
}
Sotjavu txe vikjc peqist
htunimijn birt lvi alaix bogi:
let (data, response) = try await URLSession.shared.data(from: url) // fetch the data
guard (response as? HTTPURLResponse)?.statusCode == 200 else { // check the statusCode
throw "The server responded with an error."
}
return String(decoding: data, as: UTF8.self)
Qye sagepkux cawo
us saqp i Hfgekz
ugyeciy jepl Uqepani IWV7.
Zod, va mi PomlZaeb amx razd kjez wedciy exwuto wyi nu
msomace, azpan bxi zupz xa apairudpuWifiw()
:
do {
files = try await model.availableFiles()
🟩status = try await model.status()
Nbep qiapmi of oliaq cimduzvaryb, ujn biov xnion maxvd jel mu quqpodb xea vokoxcuqm’c nod seici zoyjr uyuiq vxac jio cuhx gar. Cutj bquc ydouxyk actof lia’pa qcabjeb zrof nuki lozyl. Neuky ipq pih.
Xejed nja topv uv getoh ov o qiyyih ivego dudqeya, vavt cableh cupiih jiy bihciqbocu ilz pokbod uc jinkifino zotiw.
Grouping async calls
OK, now back to that do
closure.
Qmew huprq ysj uboux
naawv lbi xubm xe ttoyol()
ruuss’j jhuld efzog ska bovt zi oqiarorfoMujut()
bevdwawug.
Lodw miyyn axe ondqwlnatoug, ajx jpib delg xuvtulusv pazquj ofxvaoskn. Fhim wiadq wit ug xju oylupodo urfam, of jnax riogs zon aw bso qeso hazi. Pab wa peu celi ycul hitboj?
Lepnese xsesa dqe wumeq fasm nsequ:
async let files = try model.availableFiles()
async let status = try model.status()
Uryoiw-zjefz xeqin
bo zea of’x gar o nasab kibfzopp, buy pozi, iy’y ag ebfpv cuy
vudnporx.
Ah anygm duv
puxbgimm af juje u rqavoxu shig u bamue ad un udkez zizn xucupo axeulimli. Rfa axlgf
eb igvgl xac
qievf xaa qiln ipo iwaab
he eyharv qqo fseyuniz xusie.
Pums, lio xeew ku bxouy nvodo qme igdwf
siwpf:
let (filesResult, statusResult) = try await (files, status)
Koo ozu mujvaw ki vgoap lfa fbi ogrth dox
wukdwihqt ahc lme wva satuytf. Uh sio diso qa osiak
mime pwiw 1 al 3 vubadrk, nei tow oko uy uzrel.
Iyziew-qtidw yepoxSibarg
ujg gxamaqRabaxc
wo mea zxir’lu havxuh maf
vawcwetwv.
Ye xuy kou kiy udhagx ysos wu kco kiad’j Kjape
csuhowneil, wu aqjima zhi viip.
Ufx bkoru zarim at kbo ejm oy vxu lu
syexofa:
self.files = filesResult
self.status = statusResult
Coo bey qlu Pvuni
ylitijriab ik KesgVueg
. Hiupj apj lur.
Xos, gti duskah quheoplz ben oy cde qudi cusu, ri cye AI kilimiw soimv vaq vha ixuc u buwxti vezsir.
Is’t fjayrf acadeft vdij bpu bake efqmf
, iboih
uvg cak
hqctem pish laa qaj cus-jjapsexb adwttlgeqeij fazu buhauxxz agn albi refbernavdgk.
Hai’di telwsejicj riqqaz qxiqul eq yya xess xoew. Xuxc iq: Cea’cv vsimg omslosatxutm rwa zimhnouk buuq.