http-client-common
http-client-common copied to clipboard
Feature request: blocking calls
Current API is promise-based, you can't do something like val body = client.request().blockingGet().body especially on iOS. Blocking calls are particularly useful for tests but we're using them in app code, too. With rxjava it is super easy to converter blocking call to future and vice versa: Single.fromCallable and Single.blockingGet.
particularly useful for tests
By stepping in debugger and stack trace?
blocking call to future and vice versa
I've got it. Thanks for the report.
By stepping in debugger and stack trace?
No, it is mostly about API usage:
val messagesObservable: TestObservable = messagesSingle().test()
messagesObservable.assertXXX(...)
vs
val messages: List<Message> = messagesSingle().blockingGet()
assertThat(messages).containsExactly(...)