anyways, given I wrapped the executor with IO.. that was kind of my rationale, thread spawn + switch from IO to IO seems pointless and wasteful, I liked that it didnt apply threads
g
gildor
07/31/2019, 4:03 PM
well, yes the default setup so
create
There is no default setup, you choose from create() and createAsync()
About blocking
Also you loose features of okhttp dispatcher (limit amout of calls per host, limit amout of connections etc) and even more important, you make it completely non cancellable when use blocking call
And yeah, also it make it non-safe to call from UI thread (especially rom suspend functions, where it’s just harmful)
Reuse dispatchers, if you really want, but I don’t think that you get much from it
u
ursus
07/31/2019, 10:06 PM
I dont think you are correct in that
ursus
07/31/2019, 10:06 PM
if you use create no scheduler will be applied to the Singles hence its wrapped sync. api afaik, and you can definetelly cancel it and all that
g
gildor
07/31/2019, 11:23 PM
I'm talking about wrapping blocking call with coroutines, you can of course cancel this coroutine, but it will not cancel the request
u
ursus
08/01/2019, 12:31 AM
okay, but
create
is just wrapped synch call afaik and it does cancel the socket