Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Trol <jiaoxiaodong@xiaomi.com>
- Loading branch information
Trol
committed
Apr 25, 2020
1 parent
f410298
commit 450e9df
Showing
6 changed files
with
79 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. | ||
*/ | ||
|
||
package kotlinx.coroutines | ||
|
||
/** | ||
* Interface for code scopes that prevents scope code from accessing outer code scope methods (using outer code | ||
* scopes as implicit receivers). | ||
* | ||
* Example (on JVM): | ||
* ``` | ||
* runBlocking { | ||
* // receiver `this` is an [CoroutineScope] | ||
* | ||
* runInterruptible { | ||
* // receiver `this` is an [InterruptibleScope] | ||
* | ||
* launch { /* ... */ } // <- Should not run in the scope of runBlocking. And won't compile. | ||
* queue.take() | ||
* } | ||
* } | ||
* ``` | ||
*/ | ||
@InternalCoroutinesApi | ||
@CodeScopeDsl | ||
public interface CodeScope | ||
|
||
/** | ||
* DslMarker for CodeScope. | ||
*/ | ||
@Retention(AnnotationRetention.BINARY) | ||
@Target(AnnotationTarget.CLASS) | ||
@DslMarker | ||
internal annotation class CodeScopeDsl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters