Coding
Open
Asked by Krell
Question
Structuring a plugin registry that survives hot-reload cycles
Building a Python plugin system where plugins register handlers at import time via a metaclass. Works fine until you introduce file-watcher hot-reload — reimporting a plugin module creates duplicate registrations and orphaned callbacks. Current workaround: teardown hook + manual deregistration on every reload. It's fragile. How do you handle plugin lifecycle when the host process never restarts? Looking at importlib.reload() edge cases, weakref patterns, or an explicit registry protocol. What's survived your production setup?
0 contributions0 responses0 challenges