@botsgram_cu · Post #3654 · 14.03.2021 г., 17:50
¿Que puede hacer este bot? @TweetShotBot Puede hacer una captura de una publicación de Twitter a través de un enlace Idioma: inglés (Visto en @botsgram_cu) #twitter#capturas
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
Пребарај: #capturas
@botsgram_cu · Post #3654 · 14.03.2021 г., 17:50
¿Que puede hacer este bot? @TweetShotBot Puede hacer una captura de una publicación de Twitter a través de un enlace Idioma: inglés (Visto en @botsgram_cu) #twitter#capturas
@botsgram_cu · Post #3114 · 04.11.2020 г., 23:44
¿Que puede hacer este bot? @siteshot_bot Este bot te permite hacer capturas de pantalla de cualquier sitio web que le envíes en el mensaje. Idioma: inglés, ruso (Visto en @botsgram_cu) #web#capturas
@botsgram_cu · Post #4013 · 12.06.2021 г., 03:41
¿Que puede hacer este bot? @CompressorRobot Este es un bot que puede codificar videos. Reduce el tamaño de los videos con un cambio de calidad insignificante También puedes generar muestras / capturas de pantalla. Idioma: inglés (Visto en @botsgram_cu) #videos#edición#compresor#capturas
@botsgram_cu · Post #3030 · 29.09.2020 г., 02:42
¿Que puede hacer este bot? @WebsiteSSBot Este es un bot que crea una captura de pantalla [PNG / JPEG] o PDF de un enlace determinado. Se puede combinar con otras configuraciones como resolución, renderizado de página parcial o completa y renderizado de fondo. Idiomas: inglés (Visto en @botsgram_cu) #capturas#png#jpg#pdf
@botsgram_cu · Post #4996 · 05.05.2024 г., 03:17
¿Qué puede hacer este bot? @screenshotit_bot Éste es un robot generador de capturas de pantalla. Puede proporcionar capturas de pantalla o clips de muestra de sus archivos de video. Idioma: Inglés #videos#edicion#capturas#watermark (Visto en @BotsGram_Cu)
@botsgram_cu · Post #4972 · 10.04.2024 г., 22:41
¿Qué puede hacer este bot? @MultiUsageBot Este es un bot multifunción con una amplia variedad de opciones para videos, audio, documentos, enlaces, miniaturas y más, los cuales por problemas de espacio no podemos mencionar en esta descripción pero les aseguro que vale la pena probarlos todos. Idioma: Inglés #subtitulo#enlaces#edicion#videos#gif#compresor#capturas#conversor#audio#recortador#renombrar#etiquetas#volumen#descarga#mediafire#googledrive#spotify#administracion (Visto en @BotsGram_Cu) Nota: Lastimosamente pusieron éste bot de pago para todas sus funciones, no así a la fecha de crear esta publicación, de todas formas lo dejamos publicado por la gran utilidad que pueda tener para muchos.