def wait(self, cb, **params):
        check_callable(cb)
        params.update({"feed": "continuous"})
        resp = self.db.res.get("_changes", **params)

        with resp.body_stream() as body:
            while True:
                try:
                    line = body.readline()
                    if not line:
                        break
                    if line.endswith("\r\n"):
                        line = line[:-2]
                    else:
                        line = line[:-1]
                    if not line:
                        continue

                    cb(json.loads(line))
                except (__HOLE__, SystemExit,):
                    break
dataset/ETHPy150Open benoitc/couchdbkit/couchdbkit/consumer/sync.py/SyncConsumer.wait