anyways, given I wrapped the executor with IO.. th...
# coroutines
u
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
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
I dont think you are correct in that
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
I'm talking about wrapping blocking call with coroutines, you can of course cancel this coroutine, but it will not cancel the request
u
okay, but
create
is just wrapped synch call afaik and it does cancel the socket