TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #401 · 15 дек.

Функция asyncio.wait() это еще один способ вызвать множество асинхронных задач. Она работает в нескольких режимах. 1. Самый простой - ждем завершения всех задач async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(10)] done, pending = await asyncio.wait( tasks, return_when=asyncio.ALL_COMPLETED ) for task in done: try: print(task.result()) except Exception as e: print(e) Очень похоже на gather, но работает не так. ▫️возвращает не результаты, а два сета с объектами Task у которых можно забрать результат через task.result() если они в списке done ▫️не гарантирует порядок результатов так как оба объекта это set ▫️не выбрасывает исключение когда оно появляется, а сохраняет его в Task. Исключение появится когда попробуете забрать резултьтат. 2. Ждем завершения первой задачи, даже если там ошибка. async def main(): tasks = [asyncio.create_task(do_it(i)) for i in range(3)] done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_COMPLETED ) # в done может быть несколько задач! for task in done: try: print(task.result()) except Exception as e: print(f"Fail: {e}") # Оставшиеся задачи в pending, как правило, нужно отменить, иначе они будут продолжать работать for task in pending: task.cancel() В сете done будут таски которые успели завершится, причем как успешно так и нет. 3. До первой ошибки. Тоже самое, но с аргументом FIRST_EXCEPTION done, pending = await asyncio.wait( tasks, return_when=asyncio.FIRST_EXCEPTION ) Функция завершается как только первая задача упадет с ошибкой. Учтите, что в любом случае done вы можете обранужить несколько задач, как с ошибками так и успешные. ↗️ Полный листинг примеров здесь #async

Hashtags

Резултати

Пронајдени 21 слични објави

Пребарај: #kg

当前筛选 #kg清除筛选
PT风向旗

@Ptfxq · Post #167 · 05.04.2021 г., 03:57

#KG 对满足条件的用户发放1个邀请。 原文:https://telegra.ph/Invites-for-long-term-seeders-04-05

Hashtags

PT风向旗

@Ptfxq · Post #694 · 02.08.2024 г., 05:41

#KG#PTP PTP在KG开设官窑 要求如下 Members of Karagarga that have an unwarned account that is older than two years, and fulfill at least one of the below requirements, are eligible to request an invite. ▪ At least 50 uploads (25 of which must be movies) ▪ At least 10 completed subtitle pots ▪ VIP or staff tldr: 满足要求你肯定已经进了,没进你也不满足要求,也大概率满足不了要求 感谢群友投稿

Hashtags

PT风向旗

@Ptfxq · Post #375 · 14.10.2022 г., 22:00

#karagarga#KG The Pot The pot system has been functioning well for more than a decade now, big thanks to all subtitlers and pledgers. Please check if you have claimed any pots. Go to your profile, and after Pot Pledges click on (claimed pots). If you are working on a pot, leave a comment there about progress, and update that post at least every 3 months. If not, cancel your claim. A dormant claim can discourage a potential subtitler. Also, please keep an eye from time to time on pots you started or pledged to (see Pot Pledges in your profile). If good subtitles appeared in the meantime, report that pot with a link to the subs. If you want to subtitle a film for which the pot has been claimed long ago without any news, please contact one of us (corvusalbus, flipflink, cyzs, musiclova). Happy subtitling and viewing!

12
ПретходнаСтраница 1 од 2Следна