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

Пребарај: #entrepreneurs

当前筛选 #entrepreneurs清除筛选
Venture Village Wall 🦄

@venturevillagewall · Post #4276 · 01.03.2025 г., 10:00

China's New Tech Giants Emerge China's "Fantastic Four" reshapes global tech: ByteDance, DeepSeek, DJI, and Unitree. These young entrepreneurs, aged 35-45, are progressive, differing from older industry leaders. They focus on tangible innovations like drones and robots, contrasting their American counterparts. Discover more about their influence on technology's future here: SCMP #China#Tech#Entrepreneurs#ByteDance#DJI#Innovation#Drones#Robotics#Entrepreneurship#FutureTech#AI#VC#Crypto

Venture Village Wall 🦄

@venturevillagewall · Post #3612 · 21.12.2024 г., 10:21

Kaly Group Funding Update Kaly Group has raised $379.64K in funding, as of December 19, 2024. This Scottish initiative focuses on sustainable seaweed farming, delivering training and support to local communities while promoting the ecological benefits of kelp cultivation. #KalyGroup#Funding#SustainableFarming#Seaweed#Ecology#MarineEnvironment#CommunitySupport#Scotland#Kelp#Entrepreneurs

Venture Village Wall 🦄

@venturevillagewall · Post #3949 · 22.01.2025 г., 10:00

Toncoin Exclusive for Telegram Payments 🔗 *Toncoin becomes the sole cryptocurrency* for internal services in Telegram, as Telegram partners with The Open Network (TON). All in-app payments, including subscriptions and ads, must use Toncoin. Pavel Durov emphasizes enhanced user experience and security. Read more. 💰 *Donald Trump announces The Stargate Project*, an initiative with OpenAI, SoftBank, and Oracle to invest $500 billion in AI data centers in the USA over four years, starting with $100 billion this year. OpenAI will manage the facilities. Learn more. ⚖️ A dissatisfied student was awarded 2.5 million rubles by the court against entrepreneur Eduard Gurinovich for failure to deliver on the promised course content in his CEO advisory program. Find out more. 📰 *Trump pardons Ross Ulbricht*, the Silk Road founder sentenced to life imprisonment. He was a pioneer in the cryptocurrency movement, with Silk Road being one of its first platforms. Details here. #Toncoin#Telegram#AI#DataCenters#Trump#SilkRoad#Crypto#VC#Pardon#OpenAI#Blockchain#Innovation#CryptoMarket#Investment#Entrepreneurs#Legal#TechNews#USA#Darknet#Business#Funding

iGlobal Community

@iGlobalCom · Post #1438 · 19.02.2026 г., 12:22

#партнерскийпост С 20 по 22 марта YellowRocks.vc приглашает инвесторов и предпринимателей на Open.Space на Кипре. Это антиконференция без заранее подготовленной программы: участники сами предлагают темы, которые им интересны, и открыто обсуждают их в небольших группах. Зачем ехать: 1. Собрать личный совет директоров, который поможет найти ответы на сложные вопросы 2. Сверить свои решения с опытом успешных предпринимателей и инвесторов со всего мира 3. Увидеть возможности, которые можно сразу начать внедрять в свой бизнес 4. Расширить круг контактов людьми, с которыми в обычной жизни вы вряд ли пересечетесь 🔛 Узнать подробности и присоединиться: https://cutt.ly/Ftb3T4n2 Для участников сообщества действуют специальные условия по кодовому слову ⚡️ iGLOBAL. #iGLOBAL#YellowRocks#OpenSpace#нетворкинг#стартапы#инвестиции#венчур#предпринимательство#founders#venturecapital#startupcommunity#бизнессообщество#международныйбизнес#инвесторы#entrepreneurs#networkingevent

Venture Village Wall 🦄

@venturevillagewall · Post #4239 · 25.02.2025 г., 13:00

AI Startup Hits $10K Monthly Revenue AI project ReelFarm generates viral TikTok videos using templates. Recent success: over $10k MRR within the first month. Case study: an online store achieved 100k+ views without high production costs. Industry trend: growth in accessible, low-cost video creation tools. For aspiring project creators, checklist available. #AI#Video#Marketing#TikTok#Startup#Viral#MRR#ContentCreation#SocialMedia#Innovation#TechTrends#Entrepreneurship#ReelFarm#DigitalMarketing#BusinessGrowth#MicroSAAS#Entrepreneurs#VideoMarketing#DIY#Creators