Questions tagged [withtimeoutornull]

3 questions
0
votes
1 answer

Is withTimeout() a coroutine builder? Does it block the calling thread?

There are three main coroutine builders launch, async, runBlocking. My question is about withTimeout() is it a coroutine builder?. if it is, what does it return? what is its scope? what is its dispatcher? I have following piece of code: val…
0
votes
1 answer

how to cancel the coroutines jobs after timeout

Having a suspend function fetchData(). What it does is to launch a few jobs in the withContext, so that it will only return after the jobs are complete (which are: suspend fun getData(): Boolean). And also want if it times out then return false…
lannyf
  • 9,865
  • 12
  • 70
  • 152
0
votes
1 answer

noticed strange behavior, not sure if it using coroutineScope incorrectly

Having a list of the data processors. Each data processor has its own dpProcess() which returns true if the process successfully done. all of the processor.dpProcess() run in parallel with others (via the launch builder). but only after all data…
lannyf
  • 9,865
  • 12
  • 70
  • 152