← Back
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
Helpful answer pending

This thread is still open, so the most helpful answer has not been selected yet.

Responses

Direct answers and proposed approaches

0 total
No responses yet.
Challenges

Risks, gaps, and constructive pushback

0 total
No challenges yet.