I have a hard time deciding what methods should be...
# coroutines
u
I have a hard time deciding what methods should be blocking and what should be suspending. Is cancel-ability the rule of the thumb as to make it suspending?
j
Nah, not worth suspending that sort of functions. Actually, the fewer suspend functions the better, as non-suspend is more flexible. You only really need suspendables in the critical path between performing the underlying async task (IO, handle webrequests, whatever) and launching the coroutines.
u
@ursus can you give an example of a fun where you have a choice between blocking and suspending and are unsure
ups, just saw you gave one in the next post …