SingleRunner

SingleRunner

class SingleRunner

Constructors

Name Description
constructor()

Methods

afterPrevious

suspend fun <T> afterPrevious(block: suspend ()->T): T

Ensure that the block will only be executed after all previous work has completed.

When several coroutines call afterPrevious at the same time, they will queue up in the order that they call afterPrevious. Then, one coroutine will enter the block at a time.

Parameters

Name Description
block: suspend ()->T

the code to run after previous work is complete.

ReturnValue

Name Description
T