File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
common/src/main/kotlin/com/lambda/config Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,26 @@ abstract class Configuration : Jsonable {
6262 get() = File (" ${primary.parent} /${primary.nameWithoutExtension} -backup.${primary.extension} " )
6363
6464 init {
65- tryLoad() // ToDo: This will do at the moment but i'd like to run this at the first first loadable stage
65+ // We need to implement a dependency graph of loadables and add functions to run before
66+ // and/or after a given Loadable children class is initialized
67+ //
68+ // class Load1(
69+ // override val priority = 1000,
70+ // override val before = Load2,
71+ // ) : Loadable {}
72+ //
73+ // class Load2(
74+ // override val priority = 1000,
75+ // ) : Loadable {}
76+ //
77+ // class Load3(
78+ // override val priority = 1000,
79+ // override val after = Load2,
80+ // ) : Loadable {}
81+ //
82+ // clientLifecycle<Load2>(shift = Pre) { event -> } // Will run before Load2
83+ // clientLifecycle<Load2>(shift = Post) { event -> } // Will run after Load2
84+ listenUnsafe<ClientEvent .Startup > { tryLoad() }
6685 listenUnsafe<ClientEvent .Shutdown >(Int .MIN_VALUE ) { trySave() }
6786
6887 register()
You can’t perform that action at this time.
0 commit comments