promise
Deprecated
Passing a Job to coroutine builders breaks structured concurrency, leading to hard-to-diagnose errors. This pattern should be avoided. This overload will be deprecated with an error in the future.
Deprecated version of promise that accepts a Job.
See the documentation for the non-deprecated promise function to learn about the functionality of this function.
See the documentation for the deprecated async overload accepting a Job for an explanation of the reason this pattern is deprecated and the list of possible alternatives.
Deprecated
Passing a Job to coroutine builders breaks structured concurrency, leading to hard-to-diagnose errors. This pattern should be avoided. This overload will be deprecated with an error in the future.
Deprecated version of promise that accepts a Job.
See the documentation for the non-deprecated promise function to learn about the functionality of this function.
See the documentation for the deprecated async overload accepting a Job for an explanation of the reason this pattern is deprecated and the list of possible alternatives.
Starts new coroutine and returns its result as an implementation of Promise.
Coroutine context is inherited from a CoroutineScope, additional context elements can be specified with context argument. If the context does not have any dispatcher nor any other ContinuationInterceptor, then Dispatchers.Default is used. The parent job is inherited from a CoroutineScope as well, but it can also be overridden with corresponding context element.
By default, the coroutine is immediately scheduled for execution. Other options can be specified via start parameter. See CoroutineStart for details.
Parameters
additional to CoroutineScope.coroutineContext context of the coroutine.
coroutine start option. The default value is CoroutineStart.DEFAULT.
the coroutine code.