Need a way to run an action when a property changes, but only
run it once for the whole. For example, may want to restart apache,
but only once despite many config changes being made to satisfy
properties. onChange is a poor substitute.
There's endAction which can be used to register an action to run after
all properties have run. This could pretty easily be extended to take
a MVar associated with the action and use it to only run the action once.
However, running actions at the end of the propellor run doesn't let other
properties depend on the results of those actions. If an property
configures apache, and another property somehow depends on apache being
configured, deferring the apache restart to an endAction wouldn't work.
There's
endAction
which can be used to register an action to run after all properties have run. This could pretty easily be extended to take a MVar associated with the action and use it to only run the action once.However, running actions at the end of the propellor run doesn't let other properties depend on the results of those actions. If an property configures apache, and another property somehow depends on apache being configured, deferring the apache restart to an endAction wouldn't work.