Функция 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
#hacking#darkweb
👽
Dark Web 101 : Anonymous and Secure Browsing 2023
A guide to gaining knowledge about the Dark Web, Deep Web, Cryptocurrencies, Anonymity, and Security.
🗣Shubhang Prajapati
📆5/2023
🌐English
-----
Main channel: @repo_science
Coupons: @freecoupons_reposcience
-----
🇬🇧Dark Web #01
🇷🇺Паутина Тьмы #01
Два самых известных клона вернулись, чтобы забрать то, что принадлежит им по праву. Бен Рейли и Мэделин Прайор сыты по горло и снова разжигают АД! Человек-Паук и Люди Икс не готовы к грядущему, и пока непонятно, какую роль во всём этом играет Веном? Солнце садится, приближаются сумерки, а ночь обещает быть долгой.
#комикс#comics#паутинатьмы#darkweb
#чтиводня
#other#cti#cyberhunter#darkweb#deepweb#threat_intelligence
deepdarkCTI is a free project that collects and shares cyber threat intelligence (CTI) from the deep and dark web, helping you stay aware of hidden cyber threats like stolen data, ransomware, and hacker activities. It gathers information from places like Telegram, Discord, hacker forums, and ransomware sites to provide useful indicators and patterns of cyber attacks. You can join their Telegram group to discuss and suggest new sources or support the project with donations. Using deepdarkCTI helps you detect threats early, improve your cybersecurity decisions, and protect your organization from cyber attacks more effectively.
https://github.com/fastfire/deepdarkCTI
#python#ai_tool#darkweb#darkweb_osint#investigation_tool#llm_powered#osint#osint_tool
Robin is an AI tool that searches and scrapes the dark web, refines queries with large language models, filters results, and produces a concise investigation summary you can save or export, with Docker and CLI options and support for multiple LLMs (OpenAI, Anthropic, Gemini, local models) to fit your workflow. This helps you save hours of manual searching by automating multi-engine dark-web searches, scraping Onion sites via Tor, filtering noise with AI, and producing ready-to-use reports for faster, more focused OSINT investigations.
https://github.com/apurvsinghgautam/robin
🚀 Heart South Reports Potential Data Breach Affecting Thousands
Heart South has announced that approximately 46,666 individuals may have been affected by a data breach, with patient information from its network appearing on the dark web. According to NS3.AI, the company has been unable to verify if any specific individual's data was compromised. Notifications regarding the potential breach began being distributed in April 2026.
#HeartSouth#databreach#patientdata#darkweb#NS3AI#privacy#cybersecurity#datasecurity#breachnotification#April2026