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

Резултати

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

Пребарај: #bitcoinlightning

当前筛选 #bitcoinlightning清除筛选
Telegram & TON NEWS

@all_telegram_ton_news · Post #23280 · 28.02.2026 г., 12:55

🍰🚀Cake Wallet v6.0.0 is HERE! The Ultimate Privacy Powerhouse Just Got a Massive Upgrade!🥳 If you care even a little about privacy, freedom, and controlling your own money, Cake Wallet is now THE MUST-HAVE app on your phone. Period. This update takes it to a whole new level – sleek new design, lightning-fast features, and tools that scream "FREEDOM!" Let's dive into why this is a game-changer for Nostr users, freedom fighters, privacy enthusiasts, and anyone tired of Big Brother watching their wallet. 🕵️‍♂️🔒 1/ First off: Monero (XMR) Mastery – Cake Wallet has always been the king of Monero. Private by default, untraceable transactions, background sync, and automatic subaddresses. Send and receive XMR without leaving a trail. If you're a freedom fighter dodging surveillance or just value anonymity, this is your shield. No KYC, no BS. Just pure privacy. 🧡#Monero 2/ Bitcoin Silent Payments: Stealth Mode Activated!🤫 Bitcoin just got a privacy glow-up. Silent Payments let you receive BTC without reusing addresses – no more linking transactions to you. Combined with Payjoin for fee-saving, privacy-preserving sends. It's like Bitcoin on steroids for discretion. Perfect for those "off-the-grid" vibes. 3/ And NOW: Bitcoin Lightning Network via Spark!⚡💥 Instant, low-fee Bitcoin transactions? Yes! Zap sats across the globe in seconds without the high on-chain costs. This is HUGE for Nostr people – seamless zaps, tips, and micropayments on your favorite decentralized social network. Freedom fighters, rejoice: Fast, cheap, and private value transfer. No more waiting for confirmations. Zap that freedom! #Nostr#BitcoinLightning 4/ Built-in Swaps: Freedom to Trade Anywhere🔄 Swap XMR, BTC, ETH, LTC, ZEC, and more right in the app – no limits, no centralized exchanges spying on you. Jupiter DEX integration for Solana swaps, cross-chain bridges, and more. Go from BTC to XMR in taps. Privacy-preserving trades that keep your business YOUR business. Oh, and it's all non-custodial. Your keys, your coins. 🗝️ 5/ Zcash Shielded Privacy + More Chains🛡️ Added full Zcash support with auto-shielding and unified addresses. Plus Arbitrum, Base, BSC for low-fee EVM fun. Multi-chain without the hassle. For freedom tech lovers, this means more tools in your arsenal against censorship. 6/ Why It's a Must-Have for Nostr Folks & Freedom Fighters🌐 Nostr runs on Bitcoin and Lightning – Cake makes it effortless. Zap posts, support creators, all while keeping your wallet private with XMR swaps. Fighting for freedom? This app is built for you: Open-source, no data collection, Tor support, hardware wallet integration (Trezor, Ledger, BitBox). Duress PIN for safety. It's not just a wallet; it's a statement. 🫡 Update NOW: iOS, Android, Desktop. Free forever. Open-source. No telemetry. Download at https://cakewallet.com/ and taste the freedom! 🥲🫥🍰 What are you waiting for? Join the privacy revolution. #CakeWallet#Privacy#FreedomTech#Crypto (Shoutout to the Cake team for non-stop innovation! Sources: Cake Wallet GitHub releases and blog for v6.0.0 details.)