hauleth / defconst

Helper macros for defining constant values in modules
https://hex.pm/packages/defconstant
41 stars 1 forks source link

Hot code reloads in case of `defonce` #3

Open hauleth opened 5 months ago

hauleth commented 5 months ago

Currently hot code reloads will not affect defonce defined values. So the question is how it should be handled. I see few potential approaches there:

Each of these approaches have pros and cons, but I am not sure what would be the proper way to handle it.

mayel commented 5 months ago

I guess using a random key on each compile would avoid garbage collection of persistent term at the cost of storing both the old term and new one (until next time the app is restarted)?

hauleth commented 5 months ago

Pretty much. It would make cleanup of old data much harder.