Ejemplo n.º 1
0
 def refill_buffer(self):
     outgoing = len(self.producer_fifo)
     while self._pending_requests:
         request = self._pending_requests.pop(0)
         self._sending_requests.append(request)
         # Bypass AsyncChat's push because it automatically calls initiate
         self.producer_fifo.push(request.get_outgoing_producer())
     if len(self.producer_fifo) > outgoing:
         self.buffer_refills.increment()
     else:
         self.refill_skips.increment()
     return AsyncChat.refill_buffer(self)
Ejemplo n.º 2
0
 def refill_buffer(self):
     outgoing = len(self.producer_fifo)
     while self._pending_requests:
         request = self._pending_requests.pop(0)
         self._sending_requests.append(request)
         # Bypass AsyncChat's push because it automatically calls initiate
         self.producer_fifo.push(request.get_outgoing_producer())
     if len(self.producer_fifo) > outgoing:
         self.buffer_refills.increment()
     else:
         self.refill_skips.increment()
     return AsyncChat.refill_buffer(self)
Ejemplo n.º 3
0
 def refill_buffer(self):
     responsecount = self.response_counter.value
     requests = self._request_queue
     while requests[0].writable():
         self.response_counter.increment()
         self.producer_fifo.push(requests.pop(0).out)
     if requests[0] is self._null_request and not self._keep_alive:
         self.producer_fifo.push(None)
     if responsecount < self.response_counter.value:
         # Discards final call to make averages more pertinent
         self.buffer_refills.increment()
     else:
         self.refill_skips.increment()
     return AsyncChat.refill_buffer(self)
Ejemplo n.º 4
0
 def refill_buffer(self):
     responsecount = self.response_counter.value
     requests = self._request_queue
     while requests[0].writable():
         self.response_counter.increment()
         self.producer_fifo.push(requests.pop(0).out)
     if requests[0] is self._null_request and not self._keep_alive:
         self.producer_fifo.push(None)
     if responsecount < self.response_counter.value:
         # Discards final call to make averages more pertinent
         self.buffer_refills.increment()
     else:
         self.refill_skips.increment()
     return AsyncChat.refill_buffer(self)