From 80c3d33010df0ec6eff824a47907aaa6aa645c00 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sat, 28 Oct 2023 00:18:33 -0400 Subject: [PATCH] REF add note --- lib/Xmobar/Plugins/Common.hs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/Xmobar/Plugins/Common.hs b/lib/Xmobar/Plugins/Common.hs index 2295a81..60c91c2 100644 --- a/lib/Xmobar/Plugins/Common.hs +++ b/lib/Xmobar/Plugins/Common.hs @@ -112,10 +112,16 @@ withDBusClientConnection cb n logfile f = env <- mkSimpleApp lf Nothing runRIO env $ displayMaybe' cb f =<< getDBusClient n --- | Run a plugin action with a new DBus client and logfile path. --- This is necessary for DBus callbacks which run in separate threads, which --- will usually fire when the parent thread already exited and killed off its --- DBus connection and closed its logfile. +-- | Run a plugin action with a new DBus client and logfile path. This is +-- necessary for DBus callbacks which run in separate threads, which will +-- usually fire when the parent thread already exited and killed off its DBus +-- connection and closed its logfile. NOTE: unlike 'withDBusClientConnection' +-- this function will open and new logfile and client connection and close both +-- on completion. 'withDBusClientConnection' will only close the log file but +-- keep the client connection active upon termination; this client will only be +-- killed when the entire process is killed. This distinction is important +-- because callbacks only need ephemeral connections, while listeners (started +-- with 'withDBusClientConnection') need long-lasting connections. withNestedDBusClientConnection :: (MonadUnliftIO m, SafeClient c, MonadReader (PluginEnv s c) m) => Maybe BusName