@@ -105,6 +105,7 @@ module Network.HTTP.Req
105105 ( -- * Making a request
106106 -- $making-a-request
107107 req
108+ , withReqManager
108109 -- * Embedding requests into your monad
109110 -- $embedding-requests
110111 , MonadHttp (..)
@@ -418,6 +419,13 @@ globalManager = unsafePerformIO $ do
418419 newIORef manager
419420{-# NOINLINE globalManager #-}
420421
422+-- | Perform an action using global implicit 'L.Manager' that the rest of
423+-- the library uses. This allows to reuse connections that the 'L.Manager'
424+-- controls.
425+
426+withReqManager :: MonadIO m => (L.Manager -> m a) -> m a
427+withReqManager m = liftIO (readIORef globalManager) >>= m
428+
421429----------------------------------------------------------------------------
422430-- Embedding requests into your monad
423431