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

Резултати

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

Пребарај: #influencers

当前筛选 #influencers清除筛选
🦅 [ perspective ix ]

@perspectiveix · Post #1890 · 25.07.2019 г., 10:01

🤔British & American kids would much rather be YouTubers than astronauts! Last week, we had the 50th Apollo 11 anniversary, which landed Neil Armstrong and Buzz Aldrin on the surface of the Moon. On the eve of that, LEGO asked The Harris Poll to survey a total of 3,000 children in 🇺🇸🇬🇧🇨🇳 about their attitudes toward and knowledge of space. Asked what they would like to be when they grow up, about 3 in 10 American and British children replied that they wanted to be YouTubers or Vloggers. In fact, becoming an astronaut ranked last among five professions! Only in China did children have a clear preference for being an astronaut! #️⃣#SocialMedia#Influencers#YouTube#NASA 📡 from arsTechnica via Pulse. 🦅@PerspectiveIX ❓How will this affect the West in 50 years?

Open Love - AI Girlfriend

@openloveaigf · Post #66 · 18.07.2024 г., 12:00

🤫❝This is a date just for the two of us, don't let your girlfriend know.❞ 📲Download App and chat with me 🔗http://openlove.life #girlfriendgpt#aigirlfriend#spicychat#aichatbot#aiphotography18#influencers#modelstudio#spicychat#nsfwtwtًً

Venture Village Wall 🦄

@venturevillagewall · Post #3853 · 12.01.2025 г., 04:00

Whale Alerts and Hacked Accounts Update A study by Presto Research shows that large exchange deposits have weak predictive power for price declines, while VC and MM deposits offer slightly better, yet still limited, effectiveness as trading signals. In related news, Foresight Ventures’ X account was hacked, spreading fake AI crypto news, following a similar incident with Litecoin’s account promoting fraudulent tokens. Additionally, the newly launched AICC has reached a market cap of over $130 million, but faces scrutiny over its lack of transparency. Also, Morpho markets have capped positions eligible for migration with deprecated rewards for old markets. Presto ResearchAICC DashboardUsual Update #WhaleAlerts#Crypto#AI#Litecoin#ForesightVentures#AICC#MarketCap#TradingSignals#MorphoMarkets#Security#Hacking#Transparency#DeFi#MM#VC#Blockchain#DAOs#Scammers#Influencers

Venture Village Wall 🦄

@venturevillagewall · Post #4171 · 17.02.2025 г., 07:00

Argentina's President Accused in LIBRA Scandal Argentinian President Javier Milei faces fraud allegations linked to meme token LIBRA amidst a legal action led by former central bank chief. Kelsier Ventures CEO Hayden Davis claims Milei's actions triggered a crash in LIBRA's price, while insider selling reportedly occurred prior to Milei's tweet removal. Investigations are ongoing as accusations of insider knowledge circulate among influencers and projects involved. For more details, read the full report here. #LIBRA#Argentina#Crypto#MemeTokens#Fraud#JavierMilei#Kelsier#KIPProtocol#InsiderTrading#LegalIssues#HaydenDavis#Volatility#Investigation#MarketCrash#Blockchain#CryptoScandal#Influencers#Jupiter#Meteora#Finance#VC

Venture Village Wall 🦄

@venturevillagewall · Post #3348 · 18.12.2024 г., 12:06

AI Video Editor Raises $500K Diffusion Studio has secured $500K in funding as of December 4, 2024. Their AI Video Editor simplifies video editing with advanced features such as Magic Cut, Text-Based Editing, and Instant Auto-Captioning, catering to creators and businesses aiming to enhance their video production efficiency. #AI#VideoEditing#Funding#Technology#Creators#Influencers#Business#Automation#Software#Innovation#EditingTools#VideoProduction#TextBasedEditing#AutoCaptioning#Workflow#Engagement#Professional#ContentCreation#Creativity#Efficiency