Merge "Update request expired
property docsting"
This commit is contained in:
commit
f1eea7197e
@ -100,6 +100,11 @@ class WorkerTaskExecutor(executor.TaskExecutorBase):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _handle_expired_request(request):
|
def _handle_expired_request(request):
|
||||||
|
"""Handle expired request.
|
||||||
|
|
||||||
|
When request has expired it is removed from the requests cache and
|
||||||
|
the `Timeout` exception is set as a request result.
|
||||||
|
"""
|
||||||
LOG.debug("Request '%r' has expired.", request)
|
LOG.debug("Request '%r' has expired.", request)
|
||||||
request.set_result(misc.Failure.from_exception(
|
request.set_result(misc.Failure.from_exception(
|
||||||
exc.Timeout("Request '%r' has expired" % request)))
|
exc.Timeout("Request '%r' has expired" % request)))
|
||||||
|
@ -82,15 +82,14 @@ class Request(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def expired(self):
|
def expired(self):
|
||||||
"""Check if request is expired.
|
"""Check if request has expired.
|
||||||
|
|
||||||
When new request is created its state is set to the PENDING, creation
|
When new request is created its state is set to the PENDING, creation
|
||||||
time is stored and timeout is given via constructor arguments.
|
time is stored and timeout is given via constructor arguments.
|
||||||
|
|
||||||
Request is considered to be expired when it is in the PENDING state
|
Request is considered to be expired when it is in the PENDING state
|
||||||
for more then the given timeout (it is not considered to be expired
|
for more then the given timeout (it is not considered to be expired
|
||||||
in any other state). After request is expired - the `Timeout`
|
in any other state).
|
||||||
exception is raised and task is removed from the requests map.
|
|
||||||
"""
|
"""
|
||||||
if self._state == PENDING:
|
if self._state == PENDING:
|
||||||
return self._watch.expired()
|
return self._watch.expired()
|
||||||
|
Loading…
Reference in New Issue
Block a user