MCPcopy Create free account
hub / github.com/dwavesystems/dwave-cloud-client / _poll_using_long_polling

Method _poll_using_long_polling

dwave/cloud/client/base.py:1627–1639  ·  view source on GitHub ↗
(self, future: Future)

Source from the content-addressed store, hash-verified

1625 self._poll_queue.put((at, future))
1626
1627 def _poll_using_long_polling(self, future: Future) -> None:
1628 # we use problem submit time to prioritize polling of jobs submitted earlier
1629 created_at = datetime_to_timestamp(future.time_created)
1630
1631 # don't enqueue for next poll if polling_timeout is exceeded by then
1632 future_age = time.time() - created_at
1633 if self.config.polling_timeout is not None and future_age > self.config.polling_timeout:
1634 logger.debug("Polling timeout exceeded before next poll: %.2f sec > %.2f sec, aborting polling!",
1635 future_age, self.config.polling_timeout)
1636 raise PollingTimeout
1637
1638 # use the same priority queue as for backoff polling
1639 self._poll_queue.put((created_at, future))
1640
1641 def _do_poll_problems(self):
1642 """Poll the server for the status of a set of problems.

Callers 1

_pollMethod · 0.95

Calls 2

datetime_to_timestampFunction · 0.90
putMethod · 0.45

Tested by

no test coverage detected