sdk-codegen icon indicating copy to clipboard operation
sdk-codegen copied to clipboard

Kotlin: support streaming

Open tjbanghart opened this issue 2 years ago • 0 comments

LookerSDKStream methods do not begin a true stream from a Looker instance to a client. The Transport class uses HttpResponse#receive which reads all contents of the response synchronously. This can cause issues for query task endpoints that may return millions of rows e.g. run_sql_query.

I purpose that LookerSDKStream methods take an optional execution block that would allow for true streamed responses. The example in the Ktor docs is nice. I'd like to be able to do something like this:

      sdk.stream.run_sql_query(querySlug, RESULT_FORMAT) { httpResponse ->
          val channel: ByteReadChannel = httpResponse.body()
          <write_bytes_to_some_output_buffer>
      }

tjbanghart avatar Jul 17 '23 22:07 tjbanghart