@classmethod
    def dequeue_any(cls, queues, timeout):
        burst = True if not timeout else False
        job = None
        # queues must share the same connection - enforced at worker startup
        conn = queues[0].connection
        queue_names = [q.name for q in queues]
        q_lookup = dict(zip(queue_names, queues))
        default_timeout = timeout or 0
        queue_stack = queues[:]
        while True:
            while queue_stack:
                q = queue_stack.pop(0)
                if q.serial and not q.acquire_lock(timeout):
                    # promise to check the queue at timeout
                    job = None
                    promise = q.name
                else:
                    job, promise, timeout = Job._get_job_or_promise(
                        conn, q, timeout)
                if job and job.repeat:
                    self.enqueue_next(job)
                if job:
                    return job, q
            if burst:
                return
            if promise:
                queue_stack.append(promise)
            q = cls._listen_for_jobs(queue_names, conn, timeout)
            timeout = default_timeout
            queue_stack.append(q_lookup[q])
Test a call across the remote API to the API server.
dataset/ETHPy150Open bretth/django-pq/pq/queue.py/Queue.dequeue_any--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/tools/devappserver2/api_server_test.py/TestAPIServer._assert_remote_call