Функция 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
Любимые Velvetyne представили подсайт с дружественными open source шрифтовыми студиями
О многих из них я писал в рамках #oss, но нового там тоже достаточно.
Очень воодушевляет их подход к распространению, что они именуют как «libre typography».
«At Velvetyne, we’re all about promoting a more ethical approach to libre typography. We believe in respecting creators’ consent and celebrating the diverse range of voices in this creative space. We’re aware of the historical importance of our catalogue and our visibility, but we’re definitely not looking to monopolise anything».
Почитать, посмотреть, скачать
K-k开k罗l谍d影y- OSS117之开罗谍影 OSS 117: Le Caire, nid d'espions (2006)
直达链接:https://pan.quark.cn/s/48fdf8c2c548
#OSS117之开罗谍影#法国特工117
#OSS 117: Le Caire, nid d'espions
#OSS 117: Cairo, Nest of Spies
链接:https://link3.cc/sf_com
#电影#喜剧#欧洲#00年代
#ParanoidAndroid#Unofficial#ROM#OSS#U#diting
AOSPA - Uvite¹⁴ Beta 1 | Android 14
Updated : 27/01/2024
▪️Download ROM | TWRP
Notes:
- Initial Build
- Selinux Enforcing
- MiuiCamera included
- Flash latest HyperOS firmware depending on your region.
Instructions:
- Reboot to bootloader
- Flash either the provided TWRP or aospa recovery.img from sf depending on your needs
- Reboot to recovery and sideload the ROM zip
- Reboot to TWRP and install HyperOS firmware
- Format Data
- Reboot to system
Bugs? You tell me...
By: @Megalodonzs | Donate
Support: Join
#typescript#ai#nocode#oss#synthetic_data
Hugging Face AI Sheets is a free, no-code tool that lets you create, improve, and change datasets easily using AI models through a spreadsheet-like interface. You can start with your own data or generate new data by writing simple prompts. It supports thousands of open AI models and works locally or online. You can clean data, classify text, add missing info, or create synthetic data without coding. It also lets you compare different AI models and improve results by editing outputs. This tool helps you save time and effort in managing data and testing AI models quickly and flexibly.
https://github.com/huggingface/aisheets
#java#docker#mybatis#oss#springboot#vue
RuoYi-Vue-Plus is a free, open-source backend framework upgraded from RuoYi for distributed clusters and multi-tenant use, built with Spring Boot 3.5, Vue3, TypeScript, MyBatis-Plus, and Redisson. It offers superior features like plugin decoupling, advanced permissions, multi-database support, workflows, code generation, Docker deployment, monitoring, and data security tools—far beyond original RuoYi. You benefit by building scalable enterprise apps 80% faster with less code, easier maintenance, and robust security for production. Warning: Versions ≤5.5.3 have critical flaws (CVE-2025-66916 RCE, CVE-2026-2819 auth bypass); update immediately.
https://github.com/dromara/RuoYi-Vue-Plus
#rust#bigdata#cloud_native#distributed_systems#filesystem#minio#object_storage#oss#rust#s3
RustFS is a fast and safe distributed object storage system built with Rust, offering high performance and scalability for large data needs like AI and big data. It is compatible with S3, easy to use, and open source under the business-friendly Apache 2.0 license. Compared to others like MinIO, RustFS provides better memory safety, no risky data logging, and supports local cloud providers. You can quickly install it via a script or Docker, manage storage through a simple web console, and benefit from a strong community and detailed documentation. This makes RustFS a reliable, cost-effective choice for secure, scalable storage.
https://github.com/rustfs/rustfs