@@ -26,6 +26,7 @@ import kotlin.js.JsName
26
26
* Failure of one request will not cancel all streams in the others.
27
27
*/
28
28
@OptIn(InternalCoroutinesApi ::class )
29
+ @Deprecated(" StreamScope is deprecated, see https://kotlin.github.io/kotlinx-rpc/0-6-0.html" , level = DeprecationLevel .WARNING )
29
30
public class StreamScope internal constructor(
30
31
parentContext : CoroutineContext ,
31
32
internal val role : Role ,
@@ -170,6 +171,7 @@ public suspend fun <T> callScoped(callId: String, block: suspend CoroutineScope.
170
171
* }
171
172
* ```
172
173
*/
174
+ @Deprecated(" streamScoped is deprecated, see https://kotlin.github.io/kotlinx-rpc/0-6-0.html" , level = DeprecationLevel .WARNING )
173
175
@OptIn(ExperimentalContracts ::class )
174
176
public suspend fun <T > streamScoped (block : suspend CoroutineScope .() -> T ): T {
175
177
contract {
@@ -205,6 +207,7 @@ private fun CoroutineContext.checkContextForStreamScope() {
205
207
*/
206
208
@JsName(" StreamScope_fun" )
207
209
@ExperimentalRpcApi
210
+ @Deprecated(" StreamScoped is deprecated, see https://kotlin.github.io/kotlinx-rpc/0-6-0.html" , level = DeprecationLevel .WARNING )
208
211
public fun StreamScope (parent : CoroutineContext ): StreamScope {
209
212
parent.checkContextForStreamScope()
210
213
@@ -216,6 +219,10 @@ public fun StreamScope(parent: CoroutineContext): StreamScope {
216
219
*/
217
220
@OptIn(ExperimentalContracts ::class )
218
221
@ExperimentalRpcApi
222
+ @Deprecated(
223
+ " withStreamScope is deprecated, see https://kotlin.github.io/kotlinx-rpc/0-6-0.html" ,
224
+ level = DeprecationLevel .WARNING
225
+ )
219
226
public suspend fun <T > withStreamScope (scope : StreamScope , block : suspend CoroutineScope .() -> T ): T {
220
227
contract {
221
228
callsInPlace(block, InvocationKind .EXACTLY_ONCE )
@@ -252,6 +259,10 @@ public suspend fun <T> withStreamScope(scope: StreamScope, block: suspend Corout
252
259
* ```
253
260
*/
254
261
@ExperimentalRpcApi
262
+ @Deprecated(
263
+ " invokeOnStreamScopeCompletion is deprecated, see https://kotlin.github.io/kotlinx-rpc/0-6-0.html" ,
264
+ level = DeprecationLevel .WARNING
265
+ )
255
266
public suspend fun invokeOnStreamScopeCompletion (throwIfNoScope : Boolean = true, block : (Throwable ? ) -> Unit ) {
256
267
val streamScope = streamScopeOrNull() ? : noStreamScopeError()
257
268
0 commit comments