Removed dependency from kombu.five

Replace usage of five.monotonic with simple time.time().

Closes-bug: #1305784

Change-Id: I138d034ef0677f8ecb73cb978860f8d0a0a4df4e
This commit is contained in:
Serg Melikyan 2014-04-10 15:08:20 +04:00
parent 9edc16767e
commit f36d8bea5d

View File

@ -15,10 +15,10 @@
import collections
import socket
import time
from eventlet import patcher
kombu = patcher.import_patched('kombu')
five = patcher.import_patched('kombu.five')
from muranoapi.common.messaging import message
@ -51,14 +51,14 @@ class Subscription(object):
elapsed = 0.0
remaining = timeout
while True:
time_start = five.monotonic()
time_start = time.time()
if self._buffer:
return self._buffer.pop()
try:
self._connection.drain_events(timeout=timeout and remaining)
except socket.timeout:
return None
elapsed += five.monotonic() - time_start
elapsed += time.time() - time_start
remaining = timeout and timeout - elapsed or None
def _receive(self, message_data, message):