def start(self):
        if self._real_send:
            raise RuntimeError('Mocker has already been started')

        self._real_send = requests.Session.send

        def _fake_get_adapter(session, url):
            return self._adapter

        def _fake_send(session, request, **kwargs):
            real_get_adapter = requests.Session.get_adapter
            requests.Session.get_adapter = _fake_get_adapter

            try:
                return self._real_send(session, request, **kwargs)
            except exceptions.NoMockAddress:
                if not self._real_http:
                    raise
            finally:
                requests.Session.get_adapter = real_get_adapter

            return self._real_send(session, request, **kwargs)

        requests.Session.send = _fake_send
Coroutine to manage a pool of workers that accept jobs as single lines
dataset/ETHPy150Open openstack/requests-mock/requests_mock/mocker.py/MockerCore.start--crossover with--dataset/ETHPy150Open ckan/ckanapi/ckanapi/cli/workers.py/worker_pool