'Represents a single call through this middleware.
We should record the request if we have a limit relevant to it.
If no limit is relevant to the request, ignore it.  If the request
should be rate limited, return a fault telling the user they are
over the limit and need to retry later.'

@webob.dec.wsgify(RequestClass=wsgi.Request)
def __call__(self, req):

    verb = req.method
    url = req.url
    context = req.environ.get('cinder.context')
    if context:
        username = context.user_id
    else:
        username = None
    (delay, error) = self._limiter.check_for_delay(verb, url, username)
    if delay:
        msg = _('This    request    was    rate-limited.')
        retry = (time.time() + delay)
        return wsgi.OverLimitFault(msg, error, retry)
    req.environ['cinder.limits'] = self._limiter.get_limits(username)
    return self.application
