From 3bf5d240c06b3e8d00396d4bd60561d0b542c02b Mon Sep 17 00:00:00 2001 From: Nikita Volkov Date: Mon, 26 Feb 2024 22:25:33 +0300 Subject: [PATCH] Refine the docs --- src/library/other/Hasql/Pool/Config/Setting.hs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/library/other/Hasql/Pool/Config/Setting.hs b/src/library/other/Hasql/Pool/Config/Setting.hs index fbdd4ef..75e2771 100644 --- a/src/library/other/Hasql/Pool/Config/Setting.hs +++ b/src/library/other/Hasql/Pool/Config/Setting.hs @@ -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}) @@ -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}) @@ -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})