nyan icon indicating copy to clipboard operation
nyan copied to clipboard

Hot reloading

Open TheJJ opened this issue 3 years ago • 6 comments

It should be possible to hot-reload nyan files when they change.

Changes in the file could either be applied by an auto-generated patch, or the whole state is replayed with the new values.

Or some other creative idea :)

TheJJ avatar Jan 13 '21 13:01 TheJJ

you need a file watcher

wanghenshui avatar Oct 23 '21 12:10 wanghenshui

indeed, but what follows then? to what state is the database updated? :)

TheJJ avatar Oct 23 '21 18:10 TheJJ

what do you mean? pull nyan files from a central server / a cental server dispatch nyan files?

this kind of central config server just like ETCD/Zookeeper, with watch

basicly every company has it's own config central management server

wanghenshui avatar Oct 24 '21 05:10 wanghenshui

@wanghenshui

@TheJJ is referring to what should happen inside the database when a file is changed. A file watcher only tells us that a file is changed, that is true... but we need to figure out how to sanely update the database when the changes occur :D

pull nyan files from a central server / a cental server dispatch nyan files?

That's overkill for now. We can currently assume that the nyandb is running locally for one user (the openage engine) and do not have to worry about distribution over network.

heinezen avatar Oct 24 '21 12:10 heinezen

@heinezen nyandb provide a watch/subcribe api, problem solved

which db do you use? redis has subscribe, mongo has change stream

if you implement your own database, should provide some kind of feature

wanghenshui avatar Oct 24 '21 12:10 wanghenshui

@wanghenshui nyan is the database. that what we are implementing :)

heinezen avatar Oct 24 '21 15:10 heinezen