Skip to content

Commit b53b1a9

Browse files
committed
fix getting coroutine context
1 parent 79135dd commit b53b1a9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

rsocket-core/src/commonMain/kotlin/io/rsocket/kotlin/internal/RSocketRequesterImpl.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ internal class RSocketRequesterImpl(
5656
override fun requestStream(payload: suspend () -> Payload): Flow<Payload> = flow {
5757
val p = payload()
5858
p.closeOnError {
59-
val strategy = coroutineContext.requestStrategy()
59+
val strategy = currentCoroutineContext().requestStrategy()
6060
val initialRequest = strategy.firstRequest()
6161
val streamId = createStream()
6262

@@ -70,7 +70,7 @@ internal class RSocketRequesterImpl(
7070

7171
@OptIn(ExperimentalStreamsApi::class)
7272
override fun requestChannel(payloads: Flow<Payload>): Flow<Payload> = flow {
73-
val strategy = coroutineContext.requestStrategy()
73+
val strategy = currentCoroutineContext().requestStrategy()
7474
val initialRequest = strategy.firstRequest()
7575
val streamId = createStream()
7676
val receiverDeferred = CompletableDeferred<ReceiveChannel<RequestFrame>?>()

rsocket-core/src/commonMain/kotlin/io/rsocket/kotlin/internal/RSocketResponderImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ internal class RSocketResponderImpl(
8181

8282
//TODO single collect
8383
val request = flow {
84-
val strategy = coroutineContext.requestStrategy()
84+
val strategy = currentCoroutineContext().requestStrategy()
8585
val initialRequest = strategy.firstRequest()
8686
send(RequestNFrame(streamId, initialRequest))
8787
collectStream(streamId, receiver, strategy, this)

0 commit comments

Comments
 (0)