blob: bfdfa553f8ec9ee7e2b803412021ecdc2244ee81 [file] [log] [blame]
Roman Elizarovf16fd272017-02-07 11:26:00 +03001/*
Roman Elizarov1f74a2d2018-06-29 19:19:45 +03002 * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
Roman Elizarovf16fd272017-02-07 11:26:00 +03003 */
4
Roman Elizarov41c5c8b2017-01-25 13:37:15 +03005package kotlinx.coroutines.experimental
6
Roman Elizarovea4a51b2017-01-31 12:01:25 +03007import kotlin.coroutines.experimental.CoroutineContext
Roman Elizarov41c5c8b2017-01-25 13:37:15 +03008
9/**
Roman Elizarovfc7a9a22017-02-13 11:54:01 +030010 * @suppress **Deprecated**: `Deferred` incorporates functionality of `LazyDeferred`. See [Deferred].
Roman Elizarov41c5c8b2017-01-25 13:37:15 +030011 */
Roman Elizarov32d95322017-02-09 15:57:31 +030012@Deprecated(message = "`Deferred` incorporates functionality of `LazyDeferred`", level = DeprecationLevel.WARNING,
13 replaceWith = ReplaceWith("Deferred"))
14typealias LazyDeferred<T> = Deferred<T>
Roman Elizarov41c5c8b2017-01-25 13:37:15 +030015
16/**
Roman Elizarovfc7a9a22017-02-13 11:54:01 +030017 * @suppress **Deprecated**: Replace with `async(context, start = false) { ... }`. See [async].
Roman Elizarov41c5c8b2017-01-25 13:37:15 +030018 */
Roman Elizarov37984f32017-07-21 19:07:46 +030019@Suppress("DEPRECATION")
Roman Elizarov32d95322017-02-09 15:57:31 +030020@Deprecated(message = "This functionality is incorporated into `async", level = DeprecationLevel.WARNING,
21 replaceWith = ReplaceWith("async(context, start = false, block = block)"))
22public fun <T> lazyDefer(context: CoroutineContext, block: suspend CoroutineScope.() -> T) : Deferred<T> =
23 async(context, start = false, block = block)