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

Пребарај: #scammers

当前筛选 #scammers清除筛选
TONlines – News

@tonlines · Post #6994 · 30.04.2025 г., 16:58

⚡️JetTon Alerts: Beware of Scammers! #JetTon#scammers JetTon Games RU warns users about impostors pretending to be JetTon employees. These scammers falsely promise benefits such as doubling deposits and providing platform access for a fee. JetTon emphasizes that official employees never reach out first and access to their services is free. Source: link @tonlines

☎️ Phoneword

@Morgan · Post #309 · 02.10.2023 г., 05:06

💠Important to detect #Scammers When you open the profile, keep your finger on the small photo, like Telegram x, the pictures of the side will be shown with the upload date. One of the most important things to identify a fraudster is the upload date of his photos. If you see 10 photos uploaded in a day or two, you know that the new account is a scammer. Because the fraudster can't scam a one-year account and then get blocked with 4 reports... This is a simple and very important way to detect scammers. 💠#Scammer 7⃣2⃣2⃣6⃣6⃣3⃣7⃣ 👇 🌐en.wikipedia.org/wiki/Phoneword 📡@Phoneword

TONlines – News

@tonlines · Post #7167 · 12.05.2025 г., 10:57

Tonnel Network Warns Against Buying B-Day Candle #scammers#B-DayCandle Tonnel Network advises against purchasing the B-Day Candle, as issues are escalating daily. Previously, scammers have exploited refund methods, making it crucial for buyers to remain cautious. Source: link @tonlines

Hashtags

International News

@intnewsagency · Post #9385 · 26.04.2026 г., 15:36

Beware of Scammers Posing as Moscow Clinic Staff The Moscow Department of Health warns about scammers calling as clinic employees, asking for passport details, SNILS, and SMS codes. Officials emphasize that clinic staff never request such information. Sharing these details can lead to hacking of your Gosuslugi account. Stay vigilant and never disclose personal data to strangers. #Moscow#Scammers#Health#Safety The main news of Russia and the world ishere.

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