Skip to content

Commit 0a7d5ff

Browse files
committed
Deprecations
1 parent 5a4a32b commit 0a7d5ff

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/StreamScope.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import kotlin.js.JsName
2626
* Failure of one request will not cancel all streams in the others.
2727
*/
2828
@OptIn(InternalCoroutinesApi::class)
29+
@Deprecated("StreamScope is deprecated, see https://kotlin.github.io/kotlinx-rpc/0-6-0.html", level = DeprecationLevel.WARNING)
2930
public class StreamScope internal constructor(
3031
parentContext: CoroutineContext,
3132
internal val role: Role,
@@ -170,6 +171,7 @@ public suspend fun <T> callScoped(callId: String, block: suspend CoroutineScope.
170171
* }
171172
* ```
172173
*/
174+
@Deprecated("streamScoped is deprecated, see https://kotlin.github.io/kotlinx-rpc/0-6-0.html", level = DeprecationLevel.WARNING)
173175
@OptIn(ExperimentalContracts::class)
174176
public suspend fun <T> streamScoped(block: suspend CoroutineScope.() -> T): T {
175177
contract {
@@ -205,6 +207,7 @@ private fun CoroutineContext.checkContextForStreamScope() {
205207
*/
206208
@JsName("StreamScope_fun")
207209
@ExperimentalRpcApi
210+
@Deprecated("StreamScoped is deprecated, see https://kotlin.github.io/kotlinx-rpc/0-6-0.html", level = DeprecationLevel.WARNING)
208211
public fun StreamScope(parent: CoroutineContext): StreamScope {
209212
parent.checkContextForStreamScope()
210213

@@ -216,6 +219,10 @@ public fun StreamScope(parent: CoroutineContext): StreamScope {
216219
*/
217220
@OptIn(ExperimentalContracts::class)
218221
@ExperimentalRpcApi
222+
@Deprecated(
223+
"withStreamScope is deprecated, see https://kotlin.github.io/kotlinx-rpc/0-6-0.html",
224+
level = DeprecationLevel.WARNING
225+
)
219226
public suspend fun <T> withStreamScope(scope: StreamScope, block: suspend CoroutineScope.() -> T): T {
220227
contract {
221228
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
@@ -252,6 +259,10 @@ public suspend fun <T> withStreamScope(scope: StreamScope, block: suspend Corout
252259
* ```
253260
*/
254261
@ExperimentalRpcApi
262+
@Deprecated(
263+
"invokeOnStreamScopeCompletion is deprecated, see https://kotlin.github.io/kotlinx-rpc/0-6-0.html",
264+
level = DeprecationLevel.WARNING
265+
)
255266
public suspend fun invokeOnStreamScopeCompletion(throwIfNoScope: Boolean = true, block: (Throwable?) -> Unit) {
256267
val streamScope = streamScopeOrNull() ?: noStreamScopeError()
257268

0 commit comments

Comments
 (0)