You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the Channel interface returns a ListenableFuture<Response> and a Response object has an InputStream body. This makes it hard (impossible?) to efficiently implement NIO in the future.
What did you want to happen?
Should we break the Response interface now to parameterise the body type? This more closely reflects the Java11 HttpResponse object and would (I think? not yet too familiar with this) allow us to make better use of non-blocking HTTP clients.
e.g. for the Java HTTP client, we could continue to convert back to InputStream (with BodySubscribers#ofInputStream) then perhaps move to using the Jackson non-blocking parser interface in the future.
The text was updated successfully, but these errors were encountered:
I like the idea of trying to make dialogue NIO-friendly before we get too locked in.
Reading through the BodyHandlers.ofString(), it seems that the java client passes data by calling a void onNext(List<ByteBuffer> items) method and then finally calling onComplete(). I'm not 100% sure why they pass a List<ByteBuffer> rather than just calling the method multiple times, but there probably a perf optimization somewhere.
One thing to keep in mind though is that it would probably be lame to make our ApacheHttpClient calls (which expose blocking APIs) translate from InputStream -> some async flowable thingy and then translate back -> InputStream.
What happened?
Currently the Channel interface returns a
ListenableFuture<Response>
and aResponse
object has anInputStream
body. This makes it hard (impossible?) to efficiently implement NIO in the future.What did you want to happen?
Should we break the
Response
interface now to parameterise the body type? This more closely reflects the Java11 HttpResponse object and would (I think? not yet too familiar with this) allow us to make better use of non-blocking HTTP clients.e.g. for the Java HTTP client, we could continue to convert back to InputStream (with BodySubscribers#ofInputStream) then perhaps move to using the Jackson non-blocking parser interface in the future.
The text was updated successfully, but these errors were encountered: