blob: 88c08b7661bc8af7be783a6aa5bcbd2442d2fd02 [file] [log] [blame]
Roman Elizarovf16fd272017-02-07 11:26:00 +03001/*
2 * Copyright 2016-2017 JetBrains s.r.o.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Roman Elizarov41c5c8b2017-01-25 13:37:15 +030017package kotlinx.coroutines.experimental
18
Roman Elizarovea4a51b2017-01-31 12:01:25 +030019import kotlin.coroutines.experimental.CoroutineContext
Roman Elizarov41c5c8b2017-01-25 13:37:15 +030020
21/**
Roman Elizarovfc7a9a22017-02-13 11:54:01 +030022 * @suppress **Deprecated**: `Deferred` incorporates functionality of `LazyDeferred`. See [Deferred].
Roman Elizarov41c5c8b2017-01-25 13:37:15 +030023 */
Roman Elizarov32d95322017-02-09 15:57:31 +030024@Deprecated(message = "`Deferred` incorporates functionality of `LazyDeferred`", level = DeprecationLevel.WARNING,
25 replaceWith = ReplaceWith("Deferred"))
26typealias LazyDeferred<T> = Deferred<T>
Roman Elizarov41c5c8b2017-01-25 13:37:15 +030027
28/**
Roman Elizarovfc7a9a22017-02-13 11:54:01 +030029 * @suppress **Deprecated**: Replace with `async(context, start = false) { ... }`. See [async].
Roman Elizarov41c5c8b2017-01-25 13:37:15 +030030 */
Roman Elizarov37984f32017-07-21 19:07:46 +030031@Suppress("DEPRECATION")
Roman Elizarov32d95322017-02-09 15:57:31 +030032@Deprecated(message = "This functionality is incorporated into `async", level = DeprecationLevel.WARNING,
33 replaceWith = ReplaceWith("async(context, start = false, block = block)"))
34public fun <T> lazyDefer(context: CoroutineContext, block: suspend CoroutineScope.() -> T) : Deferred<T> =
35 async(context, start = false, block = block)