Closed JakobGM closed 6 years ago
I actually like the first approach of switching between persistent mode and one-shot mode depending on if certain options and/or blocks have been specified in any of the config files. The downfall of that approach is that if someone is automatically launching astrality as a background process, it would be less clear whether astrality ran in persistent or one-shot manner especially if they're regularly changing the config files. Although now that I think about it, if the user wants to force that sort of predictable behavior of running in the background persistently, the reprocess_modified_files
option's use as mentioned above would be suitable for that
Yes, I think that Astrality should be able to deduce what the user would like to do in most cases. I will start with the heuristic version, and then we could add the explicit option at some other time if we want to.
There are several ways we could go about this:
1) Each module could specify a parameter indicating if it is supposed to run in "deamon" mode. "Daemon" might be a misnomer here, as Astrality does not run as a daemon at the moment. Options:
daemon
,persist
, orkeep_running
? If one or more modules specify this, Astrality will keep running. 2) If a module contains aon_event
oron_modified
block,daemon
will be defaulted totrue
if not otherwise specified. 3) Ifreprocess_modified_files
is enabled, Astrality will keep running.Or all of this can be scrapped, and astrality can be invoked with
--keep-running
as an adittional CLI parameter. If that is the case, we have to decide what the default should be. Alternatively, this flag can overwrite the options specified above.What do you think, @sshashank124?