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

Резултати

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

Пребарај: #insidertrading

当前筛选 #insidertrading清除筛选
Trump's Ear

@trumpsear_tg · Post #2410 · 24.04.2026 г., 18:03

🇺🇸US soldier arrested for betting on Maduro’s capture — won over $400 000💰 A U.S. Army Special Forces master sergeant, Gannon Ken Van Dyke, has been arrested and charged after allegedly using classified military information to place bets on an online prediction market and win more than $400 000 based on the outcome of a covert operation that captured Venezuelan president Nicolás Maduro. Van Dyke, who was involved in Operation Absolute Resolve — the U.S. military mission that led to Maduro’s capture on January 3 — reportedly placed about 13 bets on the platform Polymarket, wagering that Maduro would be removed from power. Prosecutors say he used nonpublic knowledge of the operation to make strategic trades that paid off once the raid became public. Federal authorities have indicted him on multiple counts, including unlawful use of confidential information for personal gain, commodities fraud, wire fraud, and illegal use of classified data. Van Dyke allegedly tried to conceal his identity and the proceeds by using foreign cryptocurrency accounts and requesting deletion of his Polymarket account after the operation was announced. Officials and lawmakers have condemned the case as a serious breach of trust and a form of insider trading in prediction markets, highlighting concerns about the misuse of secret information for profit. #Military#DOJ#InsiderTrading 👂More on Trump's Ear ⚠️

Quiver Quantitative | 𝕏 You can track Cantor Fitzgerald's stock portfolio on Quiver: https://www.quiverquant.com/institutions/CANTOR%20FITZGERALD,%20L.%20P./ ~ ₿izFeed#⃣:#stockmarketdata#stockmarketnews#insidertrading

Quiver Quantitative | 𝕏 BREAKING: Cantor Fitzgerald, run by the children of Commerce Secretary Howard Lutnick, just filed a portfolio update. They bought up huge amounts of Bitcoin, Trump Media stock, and stock in the Chinese company Alibaba. Full portfolio below. ~ ₿izFeed#⃣:#stockmarketdata#stockmarketnews#insidertrading

‌Quiver Quantitative | 𝕏 BREAKING: Michael Burry, of "The Big Short" fame, just filed a portfolio update. He added: - UnitedHealth, $UNH - Lululemon, $LULU - Bruker, $BRKR - Regeneron, $REGN - MercadoLibre, $MELI Track his full portfolio on Quiver. ~ ₿izFeed#⃣:#stockmarketdata#stockmarketnews#insidertrading

‌Quiver Quantitative | 𝕏 BREAKING: Warren Buffet just filed a portfolio update. He added: - UnitedHealth, $UNH - Nucor, $NUE - Lennar, $LEN - DR Horton, $DHI - Lamar, $LAMR - Allegion, $ALLE Track his full portfolio on Quiver. ~ ₿izFeed#⃣:#stockmarketdata#stockmarketnews#insidertrading

‌Quiver Quantitative | 𝕏 BREAKING: We just received new data on Senator Dave McCormick's portfolio. He has up to $5M in Bitcoin, $IBIT. He also has to $1M in Ethereum, $ETHW. McCormick sits on the Senate Subcommittee on Digital Assets. Full portfolio up on Quiver. ~ ₿izFeed#⃣:#stockmarketdata#stockmarketnews#insidertrading

123•••56
ПретходнаСтраница 1 од 6Следна