@@ -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 )
2930public 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 )
174176public 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 )
208211public 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+ )
219226public 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+ )
255266public suspend fun invokeOnStreamScopeCompletion (throwIfNoScope : Boolean = true, block : (Throwable ? ) -> Unit ) {
256267 val streamScope = streamScopeOrNull() ? : noStreamScopeError()
257268
0 commit comments