上传者: tlforest
|
上传时间:2025/5/4 15:16:15
|
文件大小:4.79MB
|
文件类型:pdf
UsingAsyncioinPython3
Ifyou’reamongthePythondevelopersputoffbyAsyncio’scomplexity,it’stimetotakeanotherlook.Asyncioiscomplicatedbecauseitaimstosolveproblemsinconcurrentnetworkprogrammingforbothframeworkdevelopersandend-userdeveloperslikeyou.ThefeaturesyouneedtoconsiderareasmallsubsetofthewholeAsyncioAPI,butpickingouttherightfeaturesisthetrickypart.That’swherethispracticalebookcomesin.VeteranPythondeveloperCalebHattinghhelpsend-userdevelopersgainabasicunderstandingofAsyncio’sbuildingblocks—enoughtogetyoustartedwritingsimpleevent-basedprograms.You’lllearnwhyAsynciooffersasaferalternativetopreemptivemultitasking(threading)andhowthisAPIprovidesasimplewaytosupportthousandsofsimultaneoussocketconnections.GetacriticalcomparisonofAsyncioandthreadingforconcurrentnetworkprogrammingTakeanAsynciowalkthrough,includingaquickstartguidetohelpyouhitthegroundloopingwithevent-basedprogrammingLearnthedifferencebetweenAsynciofeaturesforend-userdevelopersandthoseforframeworkdevelopersUnderstandAsyncio’snewasync/awaitlanguagesyntax,includingcoroutinesandtaskandfutureAPIsGetdetailedcasestudies(withcode)ofsomepopularAsyncio-compatiblethird-partylibraries
本软件ID:10730909