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

Резултати

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

Пребарај: #diagnostics

当前筛选 #diagnostics清除筛选
Venture Village Wall 🦄

@venturevillagewall · Post #3351 · 18.12.2024 г., 12:07

OpenClinic Secures $500K Funding OpenClinic has raised $500K in funding as of December 4, 2024. Their AI platform efficiently manages medical history documentation, diagnostic triaging, and provides treatment suggestions based on established guidelines for patients. #Funding#AI#Healthcare#Medical#Diagnostics#OpenClinic#Technology#PatientCare#TreatmentGuidelines#Innovation#Startup#Telemedicine#HealthTech#MedicalHistory#Triage#PatientSupport

Venture Village Wall 🦄

@venturevillagewall · Post #4277 · 01.03.2025 г., 10:00

$30M Funding in AI and Tech Startups Recent funding highlights: - Unique FinanceGPT: $30M round, focuses on generative AI for finance. Learn more - Skylo: $30M for NTN services, satellite connectivity for devices. Explore here - Camber: $30M for healthcare financial software. Details here - Doroni Aerospace: $25M for consumer eVTOL flying cars. Read more - VerAI Discoveries: $24M, AI platform for mineral exploration. More info - Universal Diagnostics: $20.96M to develop early-stage cancer detection blood tests. See here - Norlase: $20.96M for advanced ophthalmic lasers. Find out more - ZeroNorth: $20M for solutions in global shipping, reducing carbon emissions. Explore - Enveda Biosciences: $20M for plant-powered drug discovery. Learn more - Open Meta City: $20M for real estate ownership in major cities. Discover more #AI#Tech#Finance#Healthcare#Aerospace#eVTOL#MineralExploration#Diagnostics#Ophthalmic#Shipping#DrugDiscovery#RealEstate#Startup#VC#Innovation#Funding#Investment#GenerativeAI#SmartDevices#PlantPowered

Venture Village Wall 🦄

@venturevillagewall · Post #4123 · 11.02.2025 г., 13:00

Investment Rounds Overview - February 2025 Various startups have secured funding in February 2025: - CulturePulse AI: $1.51M for AI-driven behavior analysis. - Jingcui Bio: $1.37M for biotechnological innovations. - Flock Mobility: $1.24M for electric vehicle fleets. - Genoa Instruments: $1.04M for advanced imaging technology. - WattByWatt: $975K focusing on renewable energy solutions. - Agatyca: $300.03K for educational services. - Eduvanz: $290.96K for educational finance. - Scanvio: $164.86K for AI ultrasound diagnostics in gynecology. Additionally, *Binance* and the *SEC* are seeking resolution in their ongoing case. Analysts observe BTC accumulation trends after a significant decline in Binance's reserves, recalling past market surges. For more insights, visit the full articles: Binance and SEC Update. #VC#Crypto#AI#Funding#Startups#Biotech#EV#Imaging#RenewableEnergy#Education#Diagnostics#CulturePulse#Jingcui#FlockMobility#GenoaInstruments#WattByWatt#Agatyca#Eduvanz#Scanvio#Binance#BTC