@@ -15,7 +15,6 @@ import Control.Monad
1515import Control.Monad.Catch
1616import Control.Monad.IO.Class
1717import Control.Monad.Reader
18−import Control.Retry
1918import Data.Monoid
2019import Network.Google.Auth
2120import Network.Google.Internal.Types
@@ -35,48 +34,33 @@ data Env = Env
3534-- total field initialisation.
3635
3736class HasEnv a where
38− environment :: Lens' a Env
37+ environment :: Lens' a Env
3938 {-# MINIMAL environment #-}
4039
41− -- -- | The function used to determine if an 'HttpException' should be retried.
42− -- envRetryCheck :: Lens' a (Int -> HttpException -> Bool)
43−
44− -- -- | TODO
45− -- envRetryPolicy :: Lens' a RetryPolicy
46−
4740 -- | TODO
48− envTimeout :: Lens' a (Maybe Seconds)
41+ envTimeout :: Lens' a (Maybe Seconds)
4942
5043 -- | The 'Manager' used to create and manage open HTTP connections.
51− envManager :: Lens' a Manager
44+ envManager :: Lens' a Manager
5245
5346 -- | The credentials used to sign requests for authentication with Google.
54− envAuth :: Lens' a Auth
47+ envAuth :: Lens' a Auth
5548
56− -- envRetryCheck = environment . lens _envRetryCheck (\s a -> s { _envRetryCheck = a })
57− -- envRetryPolicy = environment . lens _envRetryPolicy (\s a -> s { _envRetryPolicy = a })
58− envTimeout = environment . lens _envTimeout (\s a -> s { _envTimeout = a })
59− envManager = environment . lens _envManager (\s a -> s { _envManager = a })
60− envAuth = environment . lens _envAuth (\s a -> s { _envAuth = a })
49+ envTimeout = environment . lens _envTimeout (\s a -> s { _envTimeout = a })
50+ envManager = environment . lens _envManager (\s a -> s { _envManager = a })
51+ envAuth = environment . lens _envAuth (\s a -> s { _envAuth = a })
6152
6253instance HasEnv Env where
6354 environment = id
6455
65−-- -- | Scope an action such that any retry logic for the 'Env' is
66−-- -- ignored and any requests will at most be sent once.
67−-- once :: (MonadReader r m, HasEnv r) => m a -> m a
68−-- once = policy (limitRetries 0)
69−
70−-- -- | TODO
71−-- policy :: (MonadReader r m, HasEnv r) => RetryPolicy -> m a -> m a
72−-- policy r = local (envRetryPolicy <>~ r)
73−
7456-- | Scope an action such that any HTTP response will use this timeout value.
7557--
7658-- Default timeouts are chosen by considering:
7759--
7860-- * This 'timeout', if set.
7961--
62+-- * The related 'Service' timeout for the sent request if set. (Usually 70s)
63+--
8064-- * The 'envManager' timeout if set.
8165--
8266-- * The default 'ClientRequest' timeout. (Approximately 30s)
@@ -94,5 +78,3 @@ newEnv c = liftIO (newManager conduitManagerSettings) >>= newEnvWith c
9478-- | /See:/ 'newEnv'
9579newEnvWith :: (MonadIO m, MonadCatch m) => Credentials -> Manager -> m Env
9680newEnvWith c m = Env Nothing m <$> getAuth c
97− -- where
98− -- check _ _ = True