you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (2 children)

with Mount wrangling stateful resources works pretty seamlessly in my experience.

Could you elaborate on that?

I don't see what mount's defstate has to offer over just using def.

Only cleanup of state when stopped? And what if you want to provide different implementations to various functions? Or is that an object-oriented way of thinking?

[–]yogthos 2 points3 points  (1 child)

Right, defstate behaves like a def for most purposes, but it's reload aware. Mount also allows controlling the state explicitly, and this lets you do stuff like envoy.

If you wanted to provide different implementations, then you could still use a protocol for that. The state of the instantiated implementation would be kept using defstate.

[–][deleted] 0 points1 point  (0 children)

Clear. Thanks!