Permalink
Browse files

More doc tweaks.

  • Loading branch information...
1 parent 84f4240 commit 268eef77fee2076798308a5e462183d190bce804 @bos committed Jun 1, 2011
Showing with 10 additions and 2 deletions.
  1. +2 −1 Data/Configurator.hs
  2. +8 −1 Data/Configurator/Types/Internal.hs
View
@@ -123,7 +123,8 @@ autoConfig = AutoConfig {
, onError = const $ return ()
}
--- | Load a 'Config' from the given 'FilePath's.
+-- | Load a 'Config' from the given 'FilePath's, and start a reload
+-- thread.
--
-- At intervals, a thread checks for modifications to both the
-- original files and any files they refer to in @import@ directives,
@@ -50,6 +50,9 @@ data Config = Config {
}
-- | An action to be invoked if a configuration property is changed.
+--
+-- If this action is invoked and throws an exception, the 'onError'
+-- function will be called.
type ChangeHandler = Name
-- ^ Name of the changed property.
-> Maybe Value
@@ -114,9 +117,13 @@ data AutoConfig = AutoConfig {
-- ^ Interval (in seconds) at which to check for updates to config
-- files. The smallest allowed interval is one second.
, onError :: SomeException -> IO ()
- -- ^ Action invoked when an attempt to reload a 'Config' fails.
+ -- ^ Action invoked when an attempt to reload a 'Config' or notify
+ -- a 'ChangeHandler' causes an exception to be thrown.
+ --
-- If this action rethrows its exception or throws a new
-- exception, the modification checking thread will be killed.
+ -- You may want your application to treat that as a fatal error,
+ -- as its configuration may no longer be consistent.
} deriving (Typeable)
instance Show AutoConfig where

0 comments on commit 268eef7

Please sign in to comment.