My question was unclear – as are my thoughts.
For now, I’ll just withdraw the question.
FYI, chatted a few minutes in slack on this (below).
Thanks,
Hal
david.antaramian [12:10 PM]
@hal9000 I guess that in theory it would be possible, though it would also go against most of BEAM’s philosophy
hal9000 [12:11 PM]
@david.antaramian I see your point - but at the same time, a running app is anything but stateless.
maybe it’s more a matter of saving the BEAM’s state than the app’s…?
david.antaramian [12:13 PM]
Well, the question to me is under what circumstance you would shutdown and reload the application
hal9000 [12:13 PM]
hmm. maybe it’s all running on one box, and we’re going to reboot it?
david.antaramian [12:14 PM]
OK, following that path, will the state still be valid when you reload it?
Is there anything that will be invalid when the state is loaded back in simply from the passage of time
hal9000 [12:15 PM]
I guess in many cases it would not be valid. But in some it might be — e.g., a big 3D rendering job?
di4na [12:15 PM]
All in one box == not OTPish
david.antaramian [12:15 PM]
Well, you wouldn’t be doing that on BEAM anyways
di4na [12:15 PM]
Rule one of reliability : you need two computers
david.antaramian [12:16 PM]
But really, the point is you should save the state outside your runtime
And then read it back in in some structured and expected form when you load up a new instance
hal9000 [12:16 PM]
Your points are quite valid. I should learn more about OTP and supervision trees before I start thinking too much about this.
@david.antaramian if i understand you right, that is exactly what i was asking about
i certainly wasn’t wanting to store state inside processes
david.antaramian [12:19 PM]
You asked about saving the entire application state. I’m talking about business level logic using a source of truth
hal9000 [12:19 PM]
ok, i will have to think about the difference
i think i see what you mean, yes
hal9000 [12:21 PM]
i was probably conflating the two somewhat — e.g. i didn’t mean (necessarily) to save the stack pointer — unless we did actually snapshot the BEAM — which sounds dumber the more I think about it.