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

TGINSIGHT SIMILAR POSTS

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

Изворен канал @pythonotes · Post #425 · 20 апр.

Недавно делал быстрый прототип асинхронного приложения в котором требовалось вызывать много синхронного кода. Да, я знаю, что это не лучший дизайн, но нужно было быстрое решение на один процесс и без очередей. Поэтому я выполнял код в потоках. Выглядело это примерно так: from fastapi.concurrency import run_in_threadpool async def execute(data: DataRequest) -> DataResponse: try: result = await run_in_threadpool(sync_function, data) return DataResponse(data=result) except Exception as e: return DataResponse( error=str(e), success=False, ) В общем работает нормально. Для всех вызовов под капотом используется общий тредпул, всё работает предсказуемо. Но потребовалось изменить количество запускаемых в пуле потоков (по умолчанию создается 40 воркеров). Так как дело происходит с FastAPI, делается это через lifespan используя настройки anyio: import anyio @asynccontextmanager async def lifespan(app: FastAPI): limiter = anyio.to_thread.current_default_thread_limiter() limiter.total_tokens = 100 yield # если вдруг нужно вернуть обратно limiter.total_tokens = 40 Зачем менять количество воркеров? - уменьшить, если оперативки мало (один тред занимает ~8мб) - увеличить чтобы выдержать нагрузку Если есть предложения получше при тех же вводных - предлагайте😉 #async

Hashtags

Резултати

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

Пребарај: #recon

当前筛选 #recon清除筛选
GitHub Trends

@githubtrending · Post #15456 · 31.01.2026 г., 16:30

#typescript#investigation#osint#python#recon Flowsint is a free, open-source tool for OSINT investigations that visualizes data like domains, IPs, emails, phones, crypto wallets, and websites as interactive graphs to spot hidden links fast. Install easily with Docker and Make via git clone and "make prod," then run locally at localhost:5173 for full privacy—all data stays on your machine. With 30+ auto-enrichers (e.g., subdomain scans, WHOIS, breach checks), it chains tasks to automate deep recon, saving hours on manual work and revealing patterns for cybersecurity, journalism, or fraud probes ethically. https://github.com/reconurge/flowsint

GitHub Trends

@githubtrending · Post #15103 · 30.08.2025 г., 11:30

#python#blueteam#discovery#emails#information_gathering#osint#python#recon#reconnaissance#redteam#subdomain_enumeration theHarvester is a free, easy-to-use tool that helps you gather public information about a domain, such as emails, subdomains, IPs, and URLs, from many online sources like search engines and databases. It is useful during security testing to understand a company’s external exposure and find potential vulnerabilities. You can run it with Python and it supports features like DNS brute forcing and taking screenshots of found subdomains. Using theHarvester helps you quickly collect valuable data for cybersecurity assessments, making your research more efficient and thorough. https://github.com/laramies/theHarvester