fun <T> CoroutineScope.future(
context: CoroutineContext = EmptyCoroutineContext,
start: CoroutineStart = CoroutineStart.DEFAULT,
block: suspend CoroutineScope.() -> T
The created coroutine is cancelled when the resulting future completes successfully, fails, or is cancelled.
See newCoroutineContext for a description of debugging facilities.
context - added overlaying CoroutineScope.coroutineContext to form the new context.
start - coroutine start option. The default value is CoroutineStart.DEFAULT.
block - the code to execute.