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

Резултати

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

Пребарај: #etfs

当前筛选 #etfs清除筛选
Crypto Media

@crypto_medias · Post #1521 · 21.02.2025 г., 18:29

🗽👀 A WAVE OF CRYPTOCURRENCY #ETFS AWAITING REGULATORY APPROVAL. WHICH ETF WILL BE APPROVED NEXT?

Hashtags

SIGNAL

@finsignal · Post #3203 · 05.06.2024 г., 12:54

Yesterday, the inflow into spot #Bitcoin#ETFs amounted to ~$886.75 million — this is the second largest one-day net inflow in history.

SIGNAL

@finsignal · Post #2735 · 26.12.2023 г., 08:56

⚡️ Arthur Hayes' essay "Expression" The main theses: If the #ETFs managed by TradFi are too successful, they will completely destroy #Bitcoin If $BTC becomes just another financial asset controlled by the state, it will die Because of their confusion and laziness, people buy Bitcoin ETF derivatives, rather than buying and storing bitcoins in their own wallets.

SIGNAL

@finsignal · Post #3402 · 21.07.2024 г., 14:44

💎 American issuers of spot #Bitcoin#ETFs have accumulated more than 900,000 #BTC ($60 billion) — this is 4.3% of the total issue of the first cryptocurrency.

SpotOnChain | Announcement

@spotonchain · Post #1233 · 02.07.2025 г., 06:08

🇺🇸 Spot ETF: 🔴$342.2M to $BTC and 🟢$40.7M to $ETH 🗓 July 1, 2025 👉 BTC ETFs saw the first net outflow after 15 consecutive trading days of net inflows. 👉 ETH ETFs is on a 3-day streak of net inflows, totalling $150M. Follow @spotonchain for the latest updates about #Bitcoin and #Ethereum#ETFs now!

SpotOnChain | Announcement

@spotonchain · Post #1231 · 01.07.2025 г., 08:30

🇺🇸 Spot ETF: 🟢$102.1M to $BTC and 🟢$31.8M to $ETH 🗓 June 30, 2025 👉 BTC ETFs have seen 15 consecutive net inflows, totalling +$4.734B. Follow @spotonchain for the latest updates about #Bitcoin and #Ethereum#ETFs now!

SpotOnChain | Announcement

@spotonchain · Post #1226 · 25.06.2025 г., 04:38

🇺🇸 Spot ETF: 🟢$588.6M to $BTC and 🟢$71.3M to $ETH 🗓 June 24, 2025 👉 BTC ETFs extended their streak of net inflows to 11 trading days, totaling +$3.354B. 👉 ETH ETFs have seen 2 consecutive net inflows, with $172M added. Follow @spotonchain for the latest updates about #Bitcoin and #Ethereum#ETFs now!

SpotOnChain | Announcement

@spotonchain · Post #1222 · 19.06.2025 г., 08:12

🇺🇸 Spot ETF: 🟢$388.3M to $BTC and 🟢$19.1M to $ETH 🗓 June 18, 2025 👉 BTC ETFs have seen net inflows for 8 consecutive trading days, totaling +$2.408B. 👉 ETH ETFs also extended their streak of net inflows to 3 trading days. Follow @spotonchain for the latest updates about #Bitcoin and #Ethereum#ETFs now!

SpotOnChain | Announcement

@spotonchain · Post #1220 · 18.06.2025 г., 07:49

🇺🇸 Spot ETF: 🟢$216.5M to $BTC and 🟢$11.1M to $ETH 🗓 June 17, 2025 👉 BTC ETFs have seen net inflows for 7 consecutive trading days, totaling +$2.02B. Follow @spotonchain for the latest updates about #Bitcoin and #Ethereum#ETFs now!

123•••10•••1718
ПретходнаСтраница 1 од 18Следна