google-cloud-0.0.4: Client for the Google Cloud APIs

Safe HaskellNone
LanguageHaskell2010

Google.Cloud.Internal.Types

Synopsis

Documentation

data Handle Source

Constructors

Handle 

Fields

hManager :: !Manager

Shared HTTP manager.

hToken :: !(TVar (Maybe Token))

Cache for the access token. Use accessToken when within the Cloud monad to access the token. That function will automatically refresh it when it is about to expire.

hFetchToken :: !(Cloud Token)

The action which is used to fetch a fresh access token.

data Token Source

Constructors

Token 

Instances

evalCloud :: Handle -> Cloud a -> IO (Either Error a) Source

Evaluate a Cloud action and return either the Error or the result.

transformException :: (SomeException -> Error) -> SomeException -> IO Error Source

Transform an synchronous exception into an Error. Async exceptions are left untouched and propagated into the IO monad.

cloudIO :: IO a -> Cloud a Source

Run an IO action inside the Cloud monad, catch all synchronous exceptions and transform them into Errors.

retry :: Cloud a -> Cloud a Source

Retry a Cloud action multiple times before failing for good.

TODO: Make the retry count configurable