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 слични објави

Пребарај: #embezzlement

当前筛选 #embezzlement清除筛选
Reuters: World

@reutersworldchannel · Post #149432 · 15.10.2021 г., 21:16

South Carolina lawyer Alex Murdaugh now faces embezzlement charges Alex Murdaugh, a South Carolina lawyer accused of arranging to have himself shot so his son could collect an insurance payout, is facing new charges accusing him of embezzling settlement funds related to the 2018 death of his housekeeper. #AlexMurdaugh#AlexMurdaugh#embezzlement#News#Reuters Subscribe: http://smarturl.it/reuterssubscribe Reuters brings you the latest business, finance and breaking news video from around the globe. Our reputation for accuracy and impartiality is unparalleled. Get the latest news on: http://reuters.com/ Follow Reuters on Facebook: https://www.facebook.com/Reuters Follow Reuters on Twitter: https://twitter.com/Reuters Follow Reuters on Instagram: https://www.instagram.com/reuters/?hl=en ➖@reutersworldchannel➖

Crypto M - Crypto News

@CryptoM · Post #65188 · 11.04.2026 г., 17:35

🚀 Federal Reserve Bans Bank Employee for Embezzlement The Federal Reserve has issued a prohibition order against Mollie Morrow, a sales representative at United Bank, following accusations of embezzling $33,136 during the bank's ATM replenishment process. According to NS3.AI, Morrow pleaded guilty to the charges and has been ordered to make full restitution. Additionally, she has agreed to a ban from participating in the affairs of federally insured banks, foreign banks, and their subsidiaries. #FederalReserve#Banking#Embezzlement#UnitedBank#FinancialCrime#Restitution#BankRegulation

Venture Village Wall 🦄

@venturevillagewall · Post #3438 · 19.12.2024 г., 07:06

Major Moves in Tech and AI 🔹Avito acquires two advertising services: AdRiver and Soloway; no deal amount disclosed but estimates range from 0.5-2.5 billion rubles. More on this from RBC. 🔹Perplexity raises $500M at a $9B valuation. The AI startup specializes in delivering prompt answers to users. Previous valuation was at $3B; read more on Bloomberg. 🔹 Formerly known as TuSimple, the self-driving truck company rebrands to CreateAI, focusing on AI for video games after abandoning its trucking ambitions. Article on CNBC. 🔹 Ex-investment director of RUSNANO, Nail Gubaev, under investigation for alleged embezzlement, signs contract with the Ministry of Defense, prompting a suspension of prosecution. Details in Kommersant (link). 🔹 Insights from Smart Ranking show Russia’s medtech market grew 40% in Q3, with companies like Steplife (+258.5%) and Motorika (+190.95%) leading the growth in prosthetics. More info here: Kommersant. 🔹Broadcom reports a 220% revenue rise, solidifying its status as a $1 trillion company amidst soaring chip demand for AI. Read more on Business Insider. #Avito#Advertising#Funding#AI#Perplexity#TuSimple#CreateAI#MedTech#Prosthetics#Broadcom#RevenueGrowth#NVIDIA#Embezzlement#TechNews#Startups#China#MarketTrends#Innovation#Investments#MarketValuation#TechAcquisition