Roman Elizarov | f16fd27 | 2017-02-07 11:26:00 +0300 | [diff] [blame] | 1 | /* |
Roman Elizarov | 1f74a2d | 2018-06-29 19:19:45 +0300 | [diff] [blame^] | 2 | * Copyright 2016-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. |
Roman Elizarov | f16fd27 | 2017-02-07 11:26:00 +0300 | [diff] [blame] | 3 | */ |
| 4 | |
Roman Elizarov | 41c5c8b | 2017-01-25 13:37:15 +0300 | [diff] [blame] | 5 | package kotlinx.coroutines.experimental |
| 6 | |
Roman Elizarov | ea4a51b | 2017-01-31 12:01:25 +0300 | [diff] [blame] | 7 | import kotlin.coroutines.experimental.CoroutineContext |
Roman Elizarov | 41c5c8b | 2017-01-25 13:37:15 +0300 | [diff] [blame] | 8 | |
| 9 | /** |
Roman Elizarov | fc7a9a2 | 2017-02-13 11:54:01 +0300 | [diff] [blame] | 10 | * @suppress **Deprecated**: `Deferred` incorporates functionality of `LazyDeferred`. See [Deferred]. |
Roman Elizarov | 41c5c8b | 2017-01-25 13:37:15 +0300 | [diff] [blame] | 11 | */ |
Roman Elizarov | 32d9532 | 2017-02-09 15:57:31 +0300 | [diff] [blame] | 12 | @Deprecated(message = "`Deferred` incorporates functionality of `LazyDeferred`", level = DeprecationLevel.WARNING, |
| 13 | replaceWith = ReplaceWith("Deferred")) |
| 14 | typealias LazyDeferred<T> = Deferred<T> |
Roman Elizarov | 41c5c8b | 2017-01-25 13:37:15 +0300 | [diff] [blame] | 15 | |
| 16 | /** |
Roman Elizarov | fc7a9a2 | 2017-02-13 11:54:01 +0300 | [diff] [blame] | 17 | * @suppress **Deprecated**: Replace with `async(context, start = false) { ... }`. See [async]. |
Roman Elizarov | 41c5c8b | 2017-01-25 13:37:15 +0300 | [diff] [blame] | 18 | */ |
Roman Elizarov | 37984f3 | 2017-07-21 19:07:46 +0300 | [diff] [blame] | 19 | @Suppress("DEPRECATION") |
Roman Elizarov | 32d9532 | 2017-02-09 15:57:31 +0300 | [diff] [blame] | 20 | @Deprecated(message = "This functionality is incorporated into `async", level = DeprecationLevel.WARNING, |
| 21 | replaceWith = ReplaceWith("async(context, start = false, block = block)")) |
| 22 | public fun <T> lazyDefer(context: CoroutineContext, block: suspend CoroutineScope.() -> T) : Deferred<T> = |
| 23 | async(context, start = false, block = block) |