When experimenting, we would like the following defaults:
Don't preserve state: one could create new instances every time during experimentation, but this will just add a ton of useless stuff to the redis db. Ideally, when the program exits, all the dev instances are cleaned up. One option is to have a dev global var set, such that any component instances created in this scope will get deleted when going out of the dev scope. There can be an optional param to preserve state in dev if the user wants (?)
Don't cache results: if we do the above, then results won't be cached between two runs in dev mode.
Copy-on-write strategy for using existing instances: if there's a production instance & we runs some ops in dev mode, the edits should not propagate to the prod instance. Instead, the state should be copied on updates.
User flow:
Set env var MOTION_ENV: dev or prod. On default, it should be dev.
System internals:
If dev, check MOTION_STATE:DEV_.... first, if that doesn't exist, then read the prod state.
If writing state in dev mode, then do not write the existing prod state. Copy the state & write the copy to MOTION_STATE:DEV_....
When experimenting, we would like the following defaults:
dev
global var set, such that any component instances created in this scope will get deleted when going out of the dev scope. There can be an optional param to preserve state in dev if the user wants (?)User flow:
MOTION_ENV
:dev
orprod
. On default, it should bedev
.System internals:
MOTION_STATE:DEV_....
first, if that doesn't exist, then read the prod state.MOTION_STATE:DEV_....