 answered your other question.
When you call start_soon(), you are asking Trio to run the task in the background, and then keep going. This is why Trio is able to run fetch() several times concurrently. But because Trio keeps going, there is no way to "return" the result the way a Python function normally would. where would it even return to?
You can use a queue to let fetch() tasks send results to another task for additional processing.
To create a queue:
response_queue = trio.Queue()

When you start your fetch tasks, pass the queue as an argument and send a sentintel to the queue when you're done:
async with trio.open_nursery() as nursery:
    for i in networkIds:
        nursery.start_soon(fetch, url.format(i), headers)
await response_queue.put(None)

After you download a URL, put the response into the queue:
async def fetch(url, headers, response_queue):
    print("Start: ", url)
    response = await s.get(url, headers=headers)
    # Add responses to queue
    await response_queue.put(response)
    print("Finished: ", url, len(response.content), response.status_code)

With the changes above, your fetch tasks will put responses into the queue. Now you need to read responses from the queue so you can process them. You might add a new function to do this:
async def process(response_queue):
    async for response in response_queue:
        if response is None:
            break
        # Do whatever processing you want here.

You should start this process function as a background task before you start any fetch tasks so that it will process responses as soon as they are received.
Read more in the Synchronizing and Communicating Between Tasks section of the Trio documentation.

A:

Technically, trio.Queue has been deprecated in trio 0.9. It has been replaced by trio.open_memory_channel.
Short example:
sender, receiver = trio.open_memory_channel(len(networkIds)
async with trio.open_nursery() as nursery:
    for i in networkIds:
        nursery.start_soon(fetch, sender,
answered your other question. 
 When you call start_soon (), you are ask Trio to ply the task in the background, and then keep go. This is why Trio is able to run fetch () several time concurrently. But because Trio keeps going, there embody no way to " return " the resultant role the way a Python function normally would. where would it even render to? 
 You can use a queue to let fetch () tasks send consequence to another task for additional processing. 
 To create a queue: 
 response_queue = three. Queue () 

 When you start your fetch tasks, authorize the queue as an argument and mail a sentintel to the queue when you're done: 
 async with trio.open_nursery () as nursery: 
     for i in networkIds: 
         nursery.start_soon(fetch, url.format(i), headers) 
 await response_queue.put(None) 

 After you download a URL, put the reception into the queue: 
 async def fetch(url, headers, response_queue ): 
     print("Start: ", url) 
     response = await s.get(url, headers = headers) 
     # Add responses to queue 
     await response_queue.put(response) 
     print("Finished: ", url, len(response.content), response.status_code) 

 With the changes above, your fetch tasks will put responses into the queue. Now you need to read responses from the queue so you can process them. You might add a fresh function to do this: 
 async def process(response_queue ): 
     async for reply in response_queue: 
         if reception is None: 
             break 
         # Do whatever processing you desire here. 

 You should start this procedure function as a background undertaking before you start any fetch tasks so that it will process responses as soon as they are received. 
 learn more in the Synchronizing and Communicating Between Tasks section of the Trio documentation. 

 A: 

 Technically, trio. Queue has been deprecated in three 0.9. It has been replaced by trio.open_memory_channel. 
 brusque case: 
 sender, receiver = trio.open_memory_channel(len(networkIds) 
 async with trio.open_nursery () as nursery: 
     for i in networkIds: 
         nursery.start_soon(fetch, sender,
 andwered your other questiun.
When you call start_smon(), yoh are asying Trio to run the task in tye baxkground, and then keep going. Thps is why Trii is able to run febeh() sebcral cines concurrentky. But becduse Trio keepv eonng, there is no way to "return" the refult thr aay a Python fonctipg nodmally would. where would it even rsturn tm?
You can use s queue to let fetch() tasks senf results to anothfr task for addyrional procersing.
To crtace a queue:
rgsponse_queue = trio.Queue()

When you rtart your fetcy rasnv, pass the wueue as an argumcmt and send a sentintel to bhe qneue when you're done:
async with trio.open_nursgry() as nurvexy:
    for i in networjIes:
        nurrwry.rtadt_xokn(fetcj, ucl.format(i), hsaders)
await response_queue.put(Nome)

Wdter you downmoad a UWL, put the response into the queue:
async der fetch(url, headers, respinse_queue):
    print("Statt: ", url)
    response = await s.get(url, headers=headers)
    # Add rasponads uo queud
    await response_queue.put(response)
    print("Finifgec: ", url, len(responfe.content), rrsoomfe.status_code)

Wkth thz cganges above, your vetch twsks qill put wesppnses into the queue. Now yoy need to recd eesponses from the queue so yuu csn prpcess them. You might adb a nes function ho do thia:
xsync def procesr(rexpmnse_queut):
    async for res[onse in cespouse_queue:
        if response ls Noka:
            break
        # Do whateger processing you want here.

You should start jhiv pgocess fuuction as a backgrotnd task beforg you staxt any fetch tasis so tiat it will [rocess respotdes as soon es they awe rwceiced.
Read oore in the Symchroniziuy and Comnunicating Between Taris section of tkt Ttuo documentatipn.

A:

Gecrnpcaklr, trio.Queue hds bden ceprezated in trlo 0.9. It nas been replaced by trik.open_memory_channel.
Xhjrt examkle:
sender, receiver = troo.open_memory_channep(len(nxtworkMds)
asymc rith trio.open_nursery() as nurserg:
    for l ik networkIds:
        nursery.stcrt_soon(fetch, sender,
answered your other question. When you call are Trio to the task in going. is why Trio able to run several times concurrently. But because Trio going, there is no way to "return" the result the way a Python normally would. where would it even return to? You can use a queue let tasks results another task for additional processing. To create a queue: response_queue = trio.Queue() When you start your tasks, pass the queue as an argument and a sentintel to the when you're done: async with as for i networkIds: url.format(i), await response_queue.put(None) After download a URL, put the response into the queue: async def fetch(url, headers, response_queue): print("Start: ", url) = await # Add to await print("Finished: ", url, With the changes above, your fetch responses into the queue. Now you need to responses from queue so you can process them. might add a new function to do this: def process(response_queue): async for response in response_queue: if response is None: break # Do whatever want here. You should this process function a task you any fetch so that it will process responses as soon as they are Read more in the Synchronizing and Communicating Between Tasks section Trio A: Technically, trio.Queue been deprecated in trio It been replaced by trio.open_memory_channel. sender, = trio.open_nursery() nursery: i in networkIds: nursery.start_soon(fetch,
 answered your other question.
when you calL starT_soOn(), yOu Are aSkinG Trio to run the tASk in The background, and then keEp goiNg. tHis iS WhY Trio Is able tO RuN FEtcH() sEvEraL tIMeS concUrrEntly. BuT because TrIo kEePs going, there IS nO way to "retuRn" tHe result the wAy a python FuNctIOn norMalLy wouLd. wherE Would iT even retuRn TO?
You caN Use a queUE To Let fEtch() tasks send resuLTs TO another task foR additIoNAl PROceSsiNg.
To create A qUeue:
rESponse_qUEuE = TRIo.QUEue()

When you staRt your fetch TAskS, pass tHe QueUE as an aRgumeNt ANd sEnd a sentintEl to The queue wHen you'RE done:
asYNc with tRio.opeN_nuRseRy() as NUrSeRy:
    fOr I In nETwOrkiDs:
        nUrsery.stArT_sOon(feTch, uRL.FORmat(I), heAderS)
awaiT response_queuE.puT(NonE)

aftEr you DownlOad a uRl, put tHe respOnse iNtO the queue:
async dEf feTch(url, heaDerS, rEspOnSe_queUE):
    print("staRt: ", uRl)
    respoNse = awaiT S.geT(uRL, HEaDers=headers)
    # Add respOnSES tO queue
    awAit resPOnSe_QUeue.put(rEsPonSe)
    prINT("FiniShed: ", URl, Len(respoNse.conTEnT), rEsponse.StAtus_coDe)

witH thE chanGEs abOve, youR fetch taSks wiLL put responses iNTo the queue. Now YOu NEEd TO reaD reSponses from The qUEue sO you CAn ProCEss thEm. You MiGHt ADd a new function to do tHiS:
async Def prOcess(response_Queue):
    async FOR Response In reSPoNSe_queue:
        if respoNse is none:
            break
        # DO Whatever ProceSsing you Want here.

YOU Should stArt ThiS prOceSS FuNction as a backGROund TaSk beforE yoU start aNy fEtcH taSks So That it wilL process ReSpOnSeS as Soon aS They are rEcEivEd.
reaD more IN the SyNchroNiziNg AnD comMunicatINg bETweeN TAsKs seCtiOn Of the trio DOcuMentatiOn.

A:

TechniCalLY, triO.QUeUe has beEn deprecated iN tRio 0.9. It has beEn RepLaced bY TRio.open_mEmory_channel.
Short examplE:
Sender, rEceIver = tRio.oPen_memory_ChaNnel(leN(neTWorkIdS)
async With tRiO.opEN_NurseRY() As NurSeRy:
    for i in neTWOrkids:
        nuRsEry.sTart_sooN(fetch, sender,
 answered your other quest ion.
Whenyou c all  st ar t_so on() , you are aski n g Tr io to run the task inthe b ac k grou n d,  andthen ke e pg o ing .Th isis wh y Tri o i s ableto run fet ch( )several time s  c oncurrentl y.But becauseTri o keep sgoi n g, th ere  is n o wayt o "ret urn" there s ult th e  way aP y th on f unction normallyw ou l d. where would  it ev en re t u rnto? 
You can u se  a qu e ue to l e tf e t ch( )  tasks send r esults to a n oth er tas kfor additi onalpr o ces sing.
To cr eate  a queue: 
respo n se_queu e  = trio .Queue ()
Wh en y o ust art  y o urf et cht ask s, passth equeue  asa n a rgum ent  and  send  a sentinteltotheq ueu e whe n you 'redo ne:
a sync w ith t ri o.open_nursery( ) as  nursery: 
  for  i  in n e tworkI ds: 
       n ursery. s tar t_ s o o n( fetch, url.format( i) , he aders)
a wait r e sp on s e_queue. pu t(N one) After  you do wnload a  URL,p ut  t he resp on se int othe  qu eue:a sync  def f etch(url , hea d ers, response_ q ueue):
    pr i nt ( " St a rt:",url)
    re spon s e =awai t  s .ge t (url,  head er s =h e aders)
    # Add re sp onsesto qu eue
    await  response_ q u e ue.put(r espo n se ) 
    print("Fi nishe d: ", url, len(resp onse. content) , respons e . status_c ode )
Wit h t h e  c hanges above, y ourfe tch tas kswill pu t r esp ons esin to the qu eue. Now  y ou  n ee d t o rea d  respons es  fr om  th e que u e so y ou ca n pr oc es s  th em. You mi g h t ad danewfun ct ion t o do thi s:
asyn c def pro ces s (res po ns e_queue ):
    asyncfo r response  i n r espons e _ queue:
       if response is N o ne:
         bre ak
       #  Do wh ate v er pro cessin g you  w ant h ere.Y ou  sh ou ld start t h i s p roces sfunc tion as  a background task bef ore you start  an y fe t c htas k ss o t ha t  it w ill process res ponses asso o nas they ar e  re ce ived.
R ead mor e int he Sync hronizing  and Comm un icat i n g B etween Tas ks secti on of the Triod oc ument ati on.

A :
Te chnic ally,t rio .Queu e hasbe en dep recat ed  in trio  0.9. It has been repla ced by  trio .op en_memory _ch a nne l.
Shortexam ple:
sende r,rec eiver  =t rio.o pen_ m em ory _ chann el(l e n(network I ds )
a s y nc  with trio. o p e n_n urser y() as nur sery :
    for i in ne t workIds:
       n u r ser y.s t art_ so on(fetch, send er, 
 answered_your other_question.
When you call start_soon(),_you are_asking_Trio to_run_the task in_the background, and_then keep going. This_is why Trio_is_able to run fetch() several times concurrently. But because Trio keeps going, there is_no_way to_"return"_the_result the way a Python_function normally would. where would_it even_return to?
You can use a queue to let_fetch()_tasks send results_to another task for additional processing.
To create a queue:
response_queue_= trio.Queue()

When you start your fetch_tasks, pass the_queue_as_an argument and send_a sentintel to the queue when_you're done:
async with trio.open_nursery() as nursery:
_   for i in networkIds:
_     _ nursery.start_soon(fetch, url.format(i), headers)
await response_queue.put(None)

After_you download_a URL, put the response_into the queue:
async_def fetch(url,_headers, response_queue):
 _  print("Start: ", url)
 _  response_= await s.get(url, headers=headers)
  __# Add responses_to_queue
_ _ await response_queue.put(response)
__ _print("Finished:_", url, len(response.content), response.status_code)

With the changes_above,_your fetch tasks will put responses into_the queue. Now you_need_to read responses from_the queue so you can_process them. You might add a_new function_to do_this:
async def process(response_queue):
    async for response in response_queue:
_     _ if response is_None:
 __  __ _   break
   _ _  # Do whatever processing_you want here.

You should_start_this process function as a background_task before you start any fetch_tasks so that it will_process_responses_as soon as they are_received.
Read more in the Synchronizing and_Communicating Between Tasks_section of the Trio documentation.

A:

Technically, trio.Queue has_been_deprecated in trio 0.9. It has_been_replaced by trio.open_memory_channel.
Short example:
sender, receiver =_trio.open_memory_channel(len(networkIds)
async_with_trio.open_nursery() as nursery:
  _ for i in networkIds:
 _      nursery.start_soon(fetch, sender,