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

Резултати

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

Пребарај: #dokwon

当前筛选 #dokwon清除筛选
NEWS 鏈新聞-ABMedia

@abmedia_news · Post #24121 · 25.04.2026 г., 04:01

【🚀 交易市場|Jane Street 請求法院駁回 Terraform Labs 對 UST 崩盤之索賠訴訟 】 #DoKwon#LUNA 📍 請見報導: https://abmedia.io/jane-street-asks-court-to-reject-terraform-claims-tied-to-ust-luna-crash 📍 訂閱鏈新聞頻道:https://linktr.ee/abmedia.io

Hashtags

Venture Village Wall 🦄

@venturevillagewall · Post #3730 · 27.12.2024 г., 16:00

Do Kwon Extradited to the USA Montenegro's Justice Minister Bojan Bozovic has ordered the extradition of Do Kwon, founder of Terra, to the United States. This comes after the court denied Kwon's appeal against extradition. Kwon remains under scrutiny for alleged fraud amounting to $4.47 billion, and was arrested in March 2023. His extradition allows U.S. authorities to pursue charges related to investor deception and wealth concealment. For more details, check the full report here. #Terra#LUNA#DoKwon#crypto#extradition#Montenegro#law#fraud#SEC#blockchain

Venture Village Wall 🦄

@venturevillagewall · Post #3832 · 09.01.2025 г., 19:00

Major Crypto Transactions and Updates Today! 🚨 Significant XLM Transfers: 46,885,889 #XLM ($18.6M) and 68,463,954 #XLM ($27.2M) moved to SDF Operations. 🤑 0G Foundation raises $30M selling AI nodes, distributing up to 15% of token supply over 3 years. More Details 🔄 Key metrics identified by CryptoQuant for Bitcoin's price recovery. Link 👀 US authorities approved the sale of Silk Road Bitcoins worth $6.58B. Link 📈 Binance reports over 250 million users. Link 🧑‍⚖️ Trial for Terra's Do Kwon set for 2026. Link 🔉 Circle donates $1 million in USDC to Trump's inauguration committee. Link #XLM#AI#Crypto#VC#DeFi#Bitcoin#Ethereum#Trading#Investment#Blockchain#Finance#Security#Circle#DonaldTrump#Fundraising#SilkRoad#Binance#Terra#DoKwon#CryptoQuant

Venture Village Wall 🦄

@venturevillagewall · Post #3780 · 03.01.2025 г., 10:00

Bitcoin Turns 16: Celebrating Blockchain's Birth 🎉 Bitcoin celebrates its 16th anniversary today, marking the generation of its genesis block on January 3, 2009, by Satoshi Nakamoto. This milestone began a monetary revolution focused on decentralization and sovereignty. 🔗 Read more: Celebrating Bitcoin 🔗 Earlier report: Identity of Satoshi Nakamoto Revealed? ⚖️ On a legal note, Do Kwon faces serious accusations including fraud and money laundering, with a potential prison sentence of 130 years if convicted. His next court hearing is set for January 8. 🔗 More on Kwon: Reuters 🔮 Experts predict significant developments for cryptocurrency and AI integration by 2025, with Bitcoin potentially hitting $500,000. #Bitcoin#SatoshiNakamoto#DoKwon#Terra#Crypto#Blockchain#Fraud#MoneyLaundering#AI#VC#Economy #2025 #Cryptocurrency#Investment#BlockchainTechnology#Legal#Innovation#Milestone#Anniversary#Decentralization#PeerToPeer

Venture Village Wall 🦄

@venturevillagewall · Post #3824 · 08.01.2025 г., 22:00

Cuban Prefers Bitcoin Over Gold in Crisis Billionaire Mark Cuban states he prefers holding Bitcoin over gold in economic downturns, citing higher value potential. In Q4 2024, MicroStrategy purchased 194,180 BTC. Companies like KULR Technology, Rumble, and Genius Group are also adding Bitcoin to their balance sheets. Meanwhile, Do Kwon faces trial in 2026 for TerraUSD's $40 billion collapse. Additionally, 50 million USDC was burned at USDC Treasury. Analysts from Fidelity Digital Assets predict significant Bitcoin growth in 2025, potentially driven by countries accumulating Bitcoin as strategic reserves. #Bitcoin#Crypto#VC#MarkCuban#MicroStrategy#KULR#Rumble#GeniusGroup#DoKwon#TerraUSD#USDC#Fidelity#ETB#DigitalAssets#EconomicCrisis#Forecast#Cryptocurrency

Venture Village Wall 🦄

@venturevillagewall · Post #3858 · 12.01.2025 г., 19:00

Weekly Crypto Market Highlights 🔹 Crypto market shows volatility amid stock decline. 🔹 US Justice Department authorized sale of Silk Road bitcoins. 🔹 Court sets hearing date for Do Kwon's case. 🔹 Charges filed against operators of crypto mixers Blender and Sinbad. 🔹 In Russia, record crypto seizure to be used for state income. Read more in the full ForkLog Digest. #Crypto#Bitcoin#DoKwon#SilkRoad#Blender#Sinbad#Russia#WeekInReview#MarketVolatility#US#Justice#KYC#DeFi#Cryptocurrency#MarketOverview#Blockchain#AML#Regulation#News#ForkLog