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

Резултати

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

Пребарај: #financialchallenges

当前筛选 #financialchallenges清除筛选
Crypto M - Crypto News

@CryptoM · Post #64912 · 10.04.2026 г., 09:17

🚀 Crypto Startups Face High MiCA Compliance Costs in EU Crypto startups in the European Union are encountering significant financial challenges due to the compliance costs associated with the Markets in Crypto-Assets (MiCA) regulation. According to NS3.AI, the licensing expenses alone range from €250,000 to €500,000, posing a substantial burden on smaller firms. Austria's Financial Market Authority provides licensing timelines of less than six months, while Germany has reduced the transition period to 12 months. This has intensified the pressure on companies unable to manage the increased compliance costs. #Crypto#Startups#EU#MiCA#Compliance#Regulation#Finance#Licensing#Costs#FinancialChallenges

Crypto M - Crypto News

@CryptoM · Post #64882 · 10.04.2026 г., 06:45

🚀 Ondo Explores Challenges in Stock Perpetuals Stock perpetuals have faced persistent challenges, according to PANews. Ondo, a financial services company, has identified a three-layered structural explanation for these difficulties. The first issue is the inherent complexity of stock perpetuals, which can deter potential investors. Unlike traditional stock investments, perpetuals require a deeper understanding of financial derivatives, making them less accessible to the average investor. Secondly, the market infrastructure for stock perpetuals is not as developed as that for other financial instruments. This lack of infrastructure can lead to inefficiencies and increased costs, further discouraging participation. Lastly, regulatory uncertainties surrounding stock perpetuals contribute to their underperformance. The evolving nature of financial regulations can create an unpredictable environment, making it challenging for investors to commit to these instruments. Ondo's analysis highlights the need for improved education, infrastructure, and regulatory clarity to enhance the performance and adoption of stock perpetuals. #Ondo#StockPerpetuals#FinancialChallenges#InvestmentComplexity#MarketInfrastructure#RegulatoryUncertainty#FinancialDerivatives#InvestorEducation#FinancialRegulations#StockMarket#ONDO

Crypto M - Crypto News

@CryptoM · Post #64704 · 09.04.2026 г., 15:10

🚀 Gunzilla Games Faces Wage Delays Amid Token Decline Gunzilla Games is experiencing significant financial challenges, with employees reporting wage delays of up to five months. According to NS3.AI, CEO Vlad Korolev has stated that some payments are being scheduled to align with the company's cash flow. Several employees, including senior game programmer Vladyslav Spitkovskyi, are seeking compensation through the European Union legal framework. Additionally, the GUNZ token, integral to Off The Grid's in-game economy, has seen a substantial decline, dropping nearly 86% since its launch last year. #GunzillaGames#WageDelays#FinancialChallenges#TokenDecline#GUNZToken#OffTheGrid#GameDevelopment#EmployeeCompensation#EuropeanUnion#VladKorolev