async def METHOD_NAME(self) -> AsyncGenerator[str, None]:
    while True:
        try:
            paid = await run_sync(
                lambda: self.ln.waitanyinvoice(self.last_pay_index, timeout=2)
            )
            self.last_pay_index = paid["pay_index"]
            yield paid["payment_hash"]
        except RpcError as exc:
            # only raise if not a timeout
            if exc.error["code"] != 904:  # type: ignore
                raise
        except Exception as exc:
            logger.error(
                f"lost connection to corelightning invoices stream: '{exc}', "
                "retrying in 5 seconds"
            )
            await asyncio.sleep(5)