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

Резултати

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

Пребарај: #ros2

当前筛选 #ros2清除筛选
GitHub Trends

@githubtrending · Post #15156 · 20.09.2025 г., 13:00

#python#llm#multiagent#robotics#ros2#zenoh OpenMind's OM1 is an open-source, modular AI system that lets you build and control smart robots like humanoids, quadrupeds, and educational bots. It works with many types of sensors (cameras, LIDAR, web data) and supports physical actions like moving and talking. OM1 is easy to use with Python, supports many hardware platforms via plugins, and offers tools for debugging and voice/vision AI integration. You can quickly create custom AI agents that interact naturally and upgrade them for different robots. This helps you develop advanced, human-friendly robots that can navigate, communicate, and perform tasks autonomously or with your commands. It runs on common platforms and supports full autonomy with real-time mapping and control. This system benefits you by simplifying robot development, enabling flexible AI-powered behaviors, and supporting a wide range of hardware and applications. https://github.com/OpenMind/OM1

GitHub Trends

@githubtrending · Post #15616 · 15.04.2026 г., 12:00

#cplusplus#hap#mid_360#ros#ros2 Livox ROS Driver 2 connects your Livox LiDARs like HAP and Mid360 to ROS (Noetic) or ROS2 (Foxy/Humble/Jazzy) on matching Ubuntu versions. Clone the repo in a workspace/src folder, build Livox-SDK2, then run ./build.sh with your ROS version, and launch with roslaunch or ros2 launch files from launch_ROS1/ROS2 folders—edit JSON configs for IP, ports, frequency (up to 100Hz), and formats. This lets you quickly test and visualize point clouds in RViz for robotics development, saving time on setup and debugging. https://github.com/Livox-SDK/livox_ros_driver2

GitHub Trends

@githubtrending · Post #15225 · 15.10.2025 г., 13:00

#mdx#bilateral_teleoperation#force_feedback#genesis#gravity_compensation#humanoid_robot#imitation_learning#machine_learning#moveit2#mujoco#open_source#openarm#python#reinforcement_learning#robot#robot_arm#robotics#ros2#teleoperation OpenArm is a special robot arm that helps with physical AI research. It has 7 degrees of freedom, which means it can move like a human arm. This makes it good for tasks that involve touching or moving things safely around people. The robot is open-source, meaning anyone can build, modify, and use it. This is helpful because it makes advanced robotics available to more people, like researchers and students, without costing too much. A complete system with two arms costs about $6,500, which is much cheaper than similar robots. https://github.com/enactic/openarm