惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
宝玉的分享
宝玉的分享
Jina AI
Jina AI
IT之家
IT之家
博客园 - Franky
MyScale Blog
MyScale Blog
Y
Y Combinator Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
I
InfoQ
雷峰网
雷峰网
WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
Google DeepMind News
Google DeepMind News
美团技术团队
S
SegmentFault 最新的问题
罗磊的独立博客
博客园 - 聂微东
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
D
Docker
博客园 - 司徒正美
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
阮一峰的网络日志
阮一峰的网络日志
M
MIT News - Artificial intelligence

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
A supervisor-tree library for building predictable and re...
Di Lu · 2026-04-25 · via DEV Community
<p>🙋‍♂️ <strong>Claim: battle-tested idea, not AI-slop</strong>. I carefully designed the architecture and crafted the implementation mostly by myself (&gt;80%). AI assistance is present but mainly for creating unit tests and standalone utils.</p> <p>I just release <a href="https://github.com/namoshizun/Runsmith" rel="noopener noreferrer">Runsmith</a>, an Erlang/OTP style supervisor-tree framework for when your Python service/system is made of multiple long-running programs. </p> <h2> Brief Intro </h2> <p>Think of an ETL service with a data poller, a transformer, and a result notifier, each with its own lifecycle, failure modes, and recovery needs. Wiring this by hand with retry loops, watchdog threads, and scattered state flags brittle glue code that is hard to reason about.</p> <p>⚙️ Runsmith brings structure to this problem. Each unit becomes a worker with an explicit FSM lifecycle. A supervisor tree monitors every worker continuously — detecting stalls and timeouts, not just crashes — and confines restarts to the failed unit so the rest of the system keeps running.</p> <h2> Background story </h2> <p>The real origin story: I was building the backend for a safety-protection camera system at work. The camera is used in manufacturing plants so <u>no downtime is unacceptable</u>. The system has multiple processes all running together:</p> <ul> <li> <strong>Web app</strong>: serving the HTTP API and SSE streams</li> <li> <strong>Algorithm worker</strong>: running CV inference on incoming frames</li> <li> <strong>Camera controller</strong>: interacting with the camera device library and polling frames</li> <li> <strong>Background task</strong>: runner for scheduled jobs such as periodic data vacuuming</li> <li><strong>ONVIF service</strong></li> </ul> <p>Each one needed to run indefinitely and recover from failures without dragging the others down. The algorithm worker once stall mid-inference due to third-party driver failures. The FastAPI web app event loop once starved due to someone wrote bad sync code...</p> <p>My first version was a messy soup. Lots of state flags, retry logics, watchdogs and probes desperately trying to hold things together. It worked but hard to maintain and reason about.</p> <p>What I actually wanted was a framework where supervision is a first-class concept, fault isolation is structural rather than bolted on. More importantly, I really want an unified structure for modelling long-running stateful function units.</p> <p>So I built it. Runsmith is essentially what I wished had existed when I started that project 🤗</p> <h2> Fancy version of <code>supervisord</code>? </h2> <p>Nope 🙂‍↔️. Runsmith and supervisord solve different problems. supervisord is an OS-level process control daemon that manages external programs by PID and static config. Runsmith is an in-process, programmable Python library where the supervised unit is a typed worker with an explicit lifecycle.</p> <p>That gives a few advantages not present in supervisord:</p> <ul> <li> <strong>Rich concurrency models</strong>: beyond process-only orchestration, workers can run in threads or co-routines, or even custom execution backends.</li> <li> <strong>Fine-grained health probes</strong>: failure is not just an abnormal process exit, but a constraint violation that can be detected and recovered from.</li> <li> <strong>Supervisor-tree</strong>: Erlang/OTP style supervisor-tree for nested fault domains.</li> </ul>