コード例 #1
0
ファイル: model.py プロジェクト: stbenjam/gofer
 def next(self, timeout=90):
     """
     Get the next valid *document* from the queue.
     :param timeout: The read timeout in seconds.
     :type timeout: int
     :return: The next document.
     :rtype: tuple: (Message, Document)
     :raises: model.DocumentError
     """
     message = self.get(timeout)
     if message:
         try:
             document = auth.validate(self.authenticator, message.body)
             validate(document)
         except ModelError:
             message.ack()
             raise
         log.debug('read next: %s', document)
         return message, document
     else:
         return None, None
コード例 #2
0
ファイル: test_model.py プロジェクト: pombreda/gofer
 def test_valid(self):
     document = Document(version=VERSION)
     validate(document)
コード例 #3
0
ファイル: test_model.py プロジェクト: darinlively/gofer
 def test_valid(self):
     document = Document(version=VERSION)
     validate(document)