app
KiCad - the KiCad Bridge
Public Made by Adomby adom
Reference implementation of the KiCad bridge: multi-instance Python server, forward path via kicad-cli, reverse path via in-process plugin. Most complex of the three bundled bridges.
← Commit history
BRIDGE_VERSION+1−1@@ -1 +1 @@-0.9.4+0.9.5
bridge.json+1−1@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "kicad", "displayName": "KiCad EDA",- "version": "0.9.4",+ "version": "0.9.5", "description": "Reverse bridge for KiCad \u2014 board/schematic introspection, lint via kicad-cli, plugin install, multi-instance probe, in-process DRC.", "homepage": "https://github.com/adom-inc/adom-desktop", "author": "Adom Inc.",
server.py+8−2@@ -16,7 +16,7 @@ import subprocess from proc import run as _safe_run import sys import traceback-from http.server import HTTPServer, BaseHTTPRequestHandler+from http.server import HTTPServer, ThreadingHTTPServer, BaseHTTPRequestHandler from pathlib import Path # Platform detection for v1.7.4+ KiCad-v2 enriched helpers (runningInstances etc.)@@ -431,8 +431,14 @@ def main(): # second bind genuinely fails on Windows (SO_REUSEADDR would otherwise let # duplicates co-bind). This keeps the bridge robust no matter how aggressive # the host's spawn logic is.- class _SingleInstanceHTTPServer(HTTPServer):+ # ThreadingHTTPServer: handle each request in its own thread so a slow or+ # wedged handler (e.g. first-call plugin auto-install) never blocks the+ # health probe or other verbs — the single-threaded server otherwise serves+ # one request at a time, so AD's first verb could wedge the whole bridge and+ # make it look hung. daemon_threads so a stuck handler can't block shutdown.+ class _SingleInstanceHTTPServer(ThreadingHTTPServer): allow_reuse_address = False+ daemon_threads = True try: server = _SingleInstanceHTTPServer(("127.0.0.1", port), KiCadBridgeHandler) except OSError as e: