The underlying get_opts returns a GetResult. So ideally it would be nice to return a Python object that wraps this GetResult so that in the future we could potentially stream a result into a Python AsyncIterator. However I don't think that would ever be possible because its bytes and into_stream consume self. And you can't have a Python method that consumes self.
So I think the best approach is to currently return bytes and potentially in the future have a separate get_opts_stream method that returns an async iterator.
The underlying
get_opts
returns aGetResult
. So ideally it would be nice to return a Python object that wraps thisGetResult
so that in the future we could potentially stream a result into a Python AsyncIterator. However I don't think that would ever be possible because itsbytes
andinto_stream
consumeself
. And you can't have a Python method that consumesself
.So I think the best approach is to currently return
bytes
and potentially in the future have a separateget_opts_stream
method that returns an async iterator.I had tried with
This is implemented on top of #6, and is expected to be reviewed after that.