I was just thinking it would be nice if you were o...
# coroutines
b
I was just thinking it would be nice if you were only working in a single context (like UI, or a single thread), that it would be nice to make the default "keep using current context"
e
That is how .NET did and it, and this idea did not went well.
b
what do you mean?
e
Google for “.net task configureawait”. That’s the boilerplate that every library author has to use and be very careful not to foreget
b
I still don't understand, that controls where the continuation resumes right? I don't see why that would have to change for kotlin, I'm just talking about which context to schedule the coroutine in
for instance, if I am doing I/O in a newSingleThreadContext, but it's broken into a few different functions. Instead of adding a context variable to each function and passing it around, there could be a
currentContext
that just schedules the coroutine on the parent's context. Being able to set that as the default (maybe not permanently) would just mean not having to type
(currentContext())
everywhere
d
@elizarov I also don't see why in Vert.x or Swing or Android, the Default should not be according to it's own thread model... It might be something an end user might forget, but for someone developing a lib for interaction w/ these platforms, it could certainly be nice...