示例#1
0
文件: queue.py 项目: appannie/kombu
 def read(self, visibility_timeout=None, wait_time_seconds=None,
          callback=None):
     return self.get_messages(
         1, visibility_timeout,
         wait_time_seconds=wait_time_seconds,
         callback=transform(list_first, callback),
     )
示例#2
0
文件: queue.py 项目: appannie/kombu
 def set_timeout(self, visibility_timeout, callback=None):
     return self.set_attribute(
         'VisibilityTimeout', visibility_timeout,
         transform(
             self._on_timeout_set, callback,
         )
     )
 def get_status(self, operation, params, path='/', parent=None, verb='GET', callback=None):  # noqa
     return self.make_request(
         operation, params, path, verb,
         callback=transform(
             self._on_status_ready, callback, parent or self, operation
         ),
     )
示例#4
0
文件: queue.py 项目: appannie/kombu
 def count(self, page_size=10, vtimeout=10, callback=None,
           _attr='ApproximateNumberOfMessages'):
     return self.get_attributes(
         _attr, callback=transform(
             self._coerce_field_value, callback, _attr, int,
         ),
     )
示例#5
0
 def _get_async(self, queue, count=1, callback=None):
     q = self._new_queue(queue)
     qname = self.canonical_queue_name(queue)
     return self._get_from_sqs(
         qname, count=count, connection=self.asynsqs,
         callback=transform(self._on_messages_ready, callback, q, queue),
     )
示例#6
0
 def get_list(self, action, params, markers,
              path='/', parent=None, verb='GET', callback=None):
     return self.make_request(
         action, params, path, verb,
         callback=transform(
             self._on_list_ready, callback, parent or self, markers,
         ),
     )
 def get_list(self, operation, params, markers, path='/', parent=None, verb='POST', callback=None):  # noqa
     return self.make_request(
         operation, params, path, verb,
         callback=transform(
             self._on_list_ready, callback, parent or self, markers,
             operation
         ),
     )
示例#8
0
 def get_object(self, action, params, cls,
                path='/', parent=None, verb='GET', callback=None):
     return self.make_request(
         action, params, path, verb,
         callback=transform(
             self._on_obj_ready, callback, parent or self, cls,
         ),
     )
示例#9
0
 def count(self,
           page_size=10,
           vtimeout=10,
           callback=None,
           _attr='ApproximateNumberOfMessages'):
     return self.get_attributes(
         _attr,
         callback=transform(
             self._coerce_field_value,
             callback,
             _attr,
             int,
         ),
     )
示例#10
0
 def get_status(self,
                operation,
                params,
                path='/',
                parent=None,
                verb='GET',
                callback=None):  # noqa
     return self.make_request(
         operation,
         params,
         path,
         verb,
         callback=transform(self._on_status_ready, callback, parent or self,
                            operation),
     )
 def get_object(self,
                operation,
                params,
                path="/",
                parent=None,
                verb="GET",
                callback=None):  # noqa
     return self.make_request(
         operation,
         params,
         path,
         verb,
         callback=transform(self._on_obj_ready, callback, parent or self,
                            operation),
     )
示例#12
0
 def get_list(self,
              operation,
              params,
              markers,
              path='/',
              parent=None,
              verb='POST',
              callback=None):  # noqa
     return self.make_request(
         operation,
         params,
         path,
         verb,
         callback=transform(self._on_list_ready, callback, parent or self,
                            markers, operation),
     )
 def get_object(self,
                action,
                params,
                cls,
                path='/',
                parent=None,
                verb='GET',
                callback=None):
     return self.make_request(
         action,
         params,
         path,
         verb,
         callback=transform(
             self._on_obj_ready,
             callback,
             parent or self,
             cls,
         ),
     )
 def get_list(self,
              action,
              params,
              markers,
              path='/',
              parent=None,
              verb='GET',
              callback=None):
     return self.make_request(
         action,
         params,
         path,
         verb,
         callback=transform(
             self._on_list_ready,
             callback,
             parent or self,
             markers,
         ),
     )
示例#15
0
 def getresponse(self, callback=None):
     request = self.getrequest()
     request.then(transform(self.Response, callback))
     return self.http_client.add_request(request)
示例#16
0
 def getresponse(self, callback=None):
     request = self.getrequest()
     request.then(transform(self.Response, callback))
     return self.http_client.add_request(request)
示例#17
0
 def set_timeout(self, visibility_timeout, callback=None):
     return self.set_attribute('VisibilityTimeout', visibility_timeout,
                               transform(
                                   self._on_timeout_set,
                                   callback,
                               ))
示例#18
0
 def get_queue(self, queue_name, callback=None):
     # TODO Does not support owner_acct_id argument
     return self.get_all_queues(
         queue_name,
         transform(self._on_queue_ready, callback, queue_name),
     )
示例#19
0
 def get_queue(self, queue_name, callback=None):
     # TODO Does not support owner_acct_id argument
     return self.get_all_queues(
         queue_name,
         transform(self._on_queue_ready, callback, queue_name),
     )
示例#20
0
文件: SQS.py 项目: dzhang30/PlayDraft
 def _get_async(self, queue, count=1, callback=None):
     q = self._new_queue(queue)
     return self._get_from_sqs(
         q, count=count, connection=self.asynsqs,
         callback=transform(self._on_messages_ready, callback, q, queue),
     )
示例#21
0
文件: queue.py 项目: appannie/kombu
 def get_timeout(self, callback=None, _attr='VisibilityTimeout'):
     return self.get_attributes(
         _attr, transform(
             self._coerce_field_value, callback, _attr, int,
         ),
     )
示例#22
0
文件: queue.py 项目: appannie/kombu
 def write(self, message, delay_seconds=None, callback=None):
     return self.connection.send_message(
         self, message.get_body_encoded(), delay_seconds,
         callback=transform(self._on_message_sent, callback, message),
     )