@Dwflabs · Post #16 · 22.08.2022 г., 04:37
The future is always bright for those who can paint it with the colours of ambition, confidence, and positivity; with the right partner to support such a vision. #dwflabs#venturecapital#marketmaking
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
Пребарај: #dwflabs
@Dwflabs · Post #16 · 22.08.2022 г., 04:37
The future is always bright for those who can paint it with the colours of ambition, confidence, and positivity; with the right partner to support such a vision. #dwflabs#venturecapital#marketmaking
@Dwflabs · Post #15 · 15.08.2022 г., 07:15
The market goes up. The market goes down. In times of uncertainty, seek the right partner. The one able to guide you through the most difficult decisions. #dwflabs#venturecapital#marketmaking
@DWFLabs · Post #800 · 02.09.2024 г., 08:43
Our Business Partner of Business Development Lingling Jiang is sharing on our work and support for the space 🙌🔥 If you're around, come say hi to the team! #KSL2024#KBW2024#DWFLabs
@DWFLabs · Post #725 · 26.06.2024 г., 13:57
Could you decipher where we are? 😁 Our Business Partner of Ecosystems, Alessia Baumgartner is taking the stage soon. If you're around and would like to hear more about what we look for in projects, come join us 🔥 #Decipher2024#Algorand#DWFLabs
Hashtags
@spotonchain · Post #867 · 20.06.2024 г., 10:11
$LISTA was just listed on several exchanges with a starting price of $0.565! Note that DWF Labs (@DWFLabs) appears to be an MM of @lista_dao. In the past 2 days prior to the listing, DWF Labs received 10M $LISTA from the project and has been transferring the tokens to CEX, including: • 2.5M $LISTA to #Bitget • 2M $LISTA to #Binance • 1.5M $LISTA to #MEXC • 850K $LISTA to #Gateio • 850K $LISTA to #KuCoin Follow @spotonchain and set alerts for the #DWFLabs entity via https://platform.spotonchain.ai/en/platform/entity/122?tokens=LISTA&min_amount=1
@Dwflabs · Post #46 · 13.10.2022 г., 11:31
The Crypto Oasis Ecosystem Report 2022 for the UAE is now LIVE and DWF Labs is a part of it. Download your copy here https://t.ly/orEH #CryptoOasis#EcosystemReport#dwflabs#marketmaking#crypto