Skip to content

Commit

Permalink
Refine the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-volkov committed Feb 26, 2024
1 parent 06e54e7 commit 3bf5d24
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/library/other/Hasql/Pool/Config/Setting.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ idlenessTimeout x =
--
-- You can use 'Hasql.Connection.settings' to construct it.
--
-- @\"postgresql://postgres:postgres@localhost:5432/postgres\"@ by default.
-- By default it is:
--
-- > "postgresql://postgres:postgres@localhost:5432/postgres"
staticConnectionSettings :: Connection.Settings -> Setting
staticConnectionSettings x =
Setting (\config -> config {Config.connectionSettingsProvider = pure x})
Expand All @@ -64,7 +66,9 @@ staticConnectionSettings x =
--
-- You can use 'Hasql.Connection.settings' to construct it.
--
-- @pure \"postgresql://postgres:postgres@localhost:5432/postgres\"@ by default.
-- By default it is:
--
-- > pure "postgresql://postgres:postgres@localhost:5432/postgres"
dynamicConnectionSettings :: IO Connection.Settings -> Setting
dynamicConnectionSettings x =
Setting (\config -> config {Config.connectionSettingsProvider = x})
Expand All @@ -76,7 +80,9 @@ dynamicConnectionSettings x =
-- If the provided action is not lightweight, it's recommended to use intermediate bufferring via channels like TBQueue to avoid occupying the pool management thread for too long.
-- E.g., if the action is @'atomically' . 'writeTBQueue' yourQueue@, then reading from it and processing can be done on a separate thread.
--
-- @const (pure ())@ by default.
-- By default it is:
--
-- > const (pure ())
observationHandler :: (Observation -> IO ()) -> Setting
observationHandler x =
Setting (\config -> config {Config.observationHandler = x})

0 comments on commit 3bf5d24

Please sign in to comment.