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

Резултати

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

Пребарај: #shiba

当前筛选 #shiba清除筛选
Airdrop Presents 🗽

@airdrop_presents · Post #2204 · 19.01.2023 г., 15:49

🪂Airdrop ~ Shiba Inu (SHIB) 💲Reward: 150 Million #Shiba inu 💎 Presents Ratings: ⭐️⭐️⭐️ 👑Winners: 1,000 Lucky winners ➡️ Airdrop Page For Coingabbar 📚 How to Join Airdrop? ↪️ Signup at Coingabbar & Verify your Email to get 100k Cubs ↪️ Submit earned cubs for conversation, (1 Cub = 2 SHIB) Earn More Cubs Download the Android App/ IOS App ✏️Notes: Make sure to complete all tasks to receive rewards. ℹ️Distribution date: Will be announced by the project team after 28t-h January.

Hashtags

Alphavave Traders ️️️

@alphavave · Post #2149 · 20.05.2025 г., 12:51

Look at #SHIBA now! 💰🔥 Went from2,590%to 4,135%, that's 1,545% extra profit just by holding it a bit more A nice 41X return from this single Signal⭐ 🔸$50 would return $2,060💸 💰$50 would return $1,375💸 Enjoy 4,100% profit🆙. 🤝Congratulations allPremium Members. Now imagine if you followed the rest of the signals.. 🤑💯 We keep printing money, day after day 💯 Don't miss out - join us and start sending those gains to your bank 👇 @Kevindexter✅

Hashtags

Alphavave Traders ️️️

@alphavave · Post #2013 · 03.05.2025 г., 01:29

💰#SHIBA just smashed 2️⃣ 5️⃣ 🔠gains!Another big win, no surprise there 😌 It's business as usual - every day, like clockwork, we are in the fast lane, leaving the competition eating our dust 💰💸 We keep printing money, day after day 💯 Don't miss out - join us and start sending those gains to your bank 👇 @Kevindexter✅

Hashtags

SIGNAL

@finsignal · Post #3455 · 09.08.2024 г., 19:41

🐶 .Shizarium is getting ready for hardcore with a new version of Bor. 🧡The update will add a burning mechanism: 70% of the base fees will be converted into $SHIB tokens and removed from circulation, which may increase their price. The rest of the fees will be used to develop the ecosystem. 💡 And also announced the launch of #Shiba Eternity #Web3.

Hashtags

SIGNAL

@finsignal · Post #3408 · 24.07.2024 г., 11:08

🥸 Above is a 10-year chart of significant #altcoins and the number of non-empty wallets (#hodlers) in the corresponding networks: #Litecoin: 8.08M wallets #Dogecoin: 6.69M wallets #XRP Ledger: 5.24M Wallets #Cardano: 4.48M Wallets #Shiba Inu: 1.39M wallets #Chainlink: 722K wallets

Maximalist🍋🍋🍋

@maximalist_1 · Post #627 · 30.08.2024 г., 09:23

Данные от Santiment: 10 крупнейших кошельков удерживают значительные доли в крупнейших альткоинах, что подчеркивает проблему централизации в крипте: #Polygon (MATIC): 69.4% #Shiba Inu (SHIB): 61.2% #Uniswap (UNI): 50.8% #Pepe (PEPE): 46.1% #Ethereum (ETH): 44.0% #Tether (USDT): 33.1% #Chainlink (LINK): 31.1% #Toncoin (TON): 27.5% #Multi Collateral Dai (DAI): 24.5% #USD Coin (USDC): 19.0% 💬Мнение : Такая концентрация может повлиять на рынок, так как несколько крупных игроков могут существенно влиять на цену и ликвидность этих активов. #КриптоНовости#обзоррынка

12
ПретходнаСтраница 1 од 2Следна