I've been seeing some different projects using configuration on the same language the project was written with. I think that's very interesting and decided start playing with that idea for #RakuLang. Here is my first try: https://github.com/FCO/Configuration Please let me know your thoughts.
@smokemachine Your examples seem to only cover the (weird-to-me) case where you want your software to monitor the config file and react to changes? If you just want to run it once when your program starts, would it be
config-run(Test1Config, :file<./my-conf.rakuconfig>);
?
@colomon no, you would use `single-config-run(Test1Config, :file<./my-conf.rakuconfig>)` and it returns the config object. (Thanks, I need to add that as an example)
@colomon but yes… I think calling it without :$watch, :$signal nor any other reload method should run once. And you could use that as an waitable.
@colomon please, take a look to see the examples are better now.
@smokemachine That certainly has the example I would have expected to see! Though I'm still a bit confused about the difference between “await config-run" in the example and "single-config-run" you mentioned here.
@colomon single-config-run just returns the config object, config-run always returns an Supply, but if it has no ways to reload the config, that Supply will only emit a single config object and close.