@desi_memes_funny_jokes · Post #4775 · 10.06.2024 г., 12:41
आरे लम्बी लिस्ट बताऊ जरा देखे कितनी लम्बी लिस्ट है 🤣 #hindu#rss#history#bjp#india#yogi#hindi
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
Пребарај: #yogi
@desi_memes_funny_jokes · Post #4775 · 10.06.2024 г., 12:41
आरे लम्बी लिस्ट बताऊ जरा देखे कितनी लम्बी लिस्ट है 🤣 #hindu#rss#history#bjp#india#yogi#hindi
@laughinglotus · Post #807 · 12.08.2025 г., 10:23
Tigers on the walls and in the smoke: According to the ancient Kagyu tradition, the gates of all temples are decorated with tiger patterns, especially the mother tiger playing with her cubs. This majestic image not only shows the fearlessness of the vajra dharma protectors, but also symbolizes that the masters of the Kagyu Golden Garland tradition are as strong as iron and stone, with proud bones and compassionate hearts they are free and benefit all living beings. In this picture, taken in the 1970's, the Venerable 16th Karmapa is sitting on a wooden chair, and the third Jamgon Kongtrul Rinpoche stands respectfully beside him. Jamgon Kongtrul Rinpoche lowered his eyes and stared at the Tibetan incense in his hand. The mist was flowing and changing in the air. With the tigers on the temple entrance wall as a backdrop, the rising incense smoke gradually condensed and naturally showed the image of a lion with its head raised and roaring—pure appearances of the Vajrayana, showing the uninterrupted tiger-like power of the enlightened Kagyu Golden Garland tradition. • • • www.instagram.com/pemalotus #karmapa#kagyu#jamgonkongtrul#karmapakhyenno#karmapachenno#karmakagyu#kagyupa#jamgonkongtrulrinpoche#vajrayana#mahamudra#vajrayanabuddhism#yogi#yogini#buddhistmasters