-- |Open a connection and run an IO action, ensuring it is properly closed when
-- you're done.
withConnection :: BusType -> (Connection -> IO a) -> IO a
withConnection bt = bracket (busGet bt) busConnectionUnref
withConnection :: BusType -> (Connection -> IO a) -> IO a
withConnection bt = bracket (busGet bt) busConnectionUnref
withConnection bt = bracket (busGet bt) busConnectionUnref