docs: def request(device, response_queue, payload, timeout_s=None, poll=POLL_QUEUES):
      '''
      Send payload to serial device and wait for response.
  
      Parameters
      ----------
      device : serial.Serial
          Serial instance.
      response_queue : Queue.Queue
          Queue to wait for response on.
      payload : str or bytes
          Payload to send.
      timeout_s : float, optional
          Maximum time to wait (in seconds) for response.
  
          By default, block until response is ready.
      poll : bool, optional
          If ``True``, poll response queue in a busy loop until response is
          ready (or timeout occurs).
  
          Polling is much more processor intensive, but (at least on Windows)
          results in faster response processing.  On Windows, polling is
          enabled by default.
      '''
      device.write(payload)
      if poll:
          # Polling enabled.  Wait for response in busy loop.
          start = dt.datetime.now()
          while not response_queue.qsize():
              if (dt.datetime.now() - start).total_seconds() > timeout_s:
                  raise queue.Empty('No response received.')
          return response_queue.get()
      else:
          # Polling disabled.  Use blocking `Queue.get()` method to wait for
          # response.
          return response_queue.get(timeout=timeout_s)