@TestFlightX · Post #34607 · 14.11.2024 г., 11:55
#ZAP#NOTES https://testflight.apple.com/join/pjpeTkap
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
Пребарај: #zap
@TestFlightX · Post #34607 · 14.11.2024 г., 11:55
#ZAP#NOTES https://testflight.apple.com/join/pjpeTkap
@TestFlightX · Post #34286 · 12.10.2024 г., 03:54
#ZAP#ZAP#MULTIPLAYER https://testflight.apple.com/join/GJrfD9Ue
Hashtags
@tonevents_en · Post #1726 · 12.08.2025 г., 13:29
ZAP and Auto-fill for Bidask, reward distribution and contest with TaskOn 💪ZAP and Auto-fill: now you can add liquidity with only one type of tokens in your wallet, your position will be balanced automatically. Auto-fill is useful for selecting and evenly distributing the second type of tokens, depending on the chosen strategy. 👍 Reward distribution: farming in the 🪙WEB3 / TON pool ended on August 5, the final reward calculation is underway. For the 🪙 HYDRA / TON pool, everything has already been sent to wallets, while the long-term distribution from HYDRA themselves will continue. 🪙 TeFi Alliance campaign has also ended, $2 000 for farming tgUSD has already been sent. 🏆Bidask x TaskOn contest - prize pool $500, the contest will last from August 7 to 21. Conditions below: ➡️Swaps tokens worth $10 or more. ➡️Add liquidity from $10. ➡️More actions = more XP = higher chance of getting a reward. 1st place — $100 2nd place — $90 3rd place — $75 4th place — $60 5th place — $50 6th place — $40 7th place — $30 8th place — $25 9th–10th places — $15 each #Bidask#ZAP#rewards#contest
@swift_airdrops · Post #5125 · 10.04.2024 г., 17:57
⚡️ Airdrop ZAP Chain is finally here! Just Follow the steps 🔥 👉 Join here :- zapchain.io/node-sale/0M7WMX6JXO ➖ Connect your X ➖ Connect your evm ➖ Complete all tasks ➖ Done #Note : 3 days left only guys Don't miss because Snapshot on 13 April at 13:00 UTC Confirmed 🔥#ZAP#ZAPlayer2#Runes#Airdrop