Skip to content

Commit

Permalink
fix getting coroutine context
Browse files Browse the repository at this point in the history
  • Loading branch information
whyoleg committed Nov 12, 2020
1 parent 79135dd commit b53b1a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ internal class RSocketRequesterImpl(
override fun requestStream(payload: suspend () -> Payload): Flow<Payload> = flow {
val p = payload()
p.closeOnError {
val strategy = coroutineContext.requestStrategy()
val strategy = currentCoroutineContext().requestStrategy()
val initialRequest = strategy.firstRequest()
val streamId = createStream()

Expand All @@ -70,7 +70,7 @@ internal class RSocketRequesterImpl(

@OptIn(ExperimentalStreamsApi::class)
override fun requestChannel(payloads: Flow<Payload>): Flow<Payload> = flow {
val strategy = coroutineContext.requestStrategy()
val strategy = currentCoroutineContext().requestStrategy()
val initialRequest = strategy.firstRequest()
val streamId = createStream()
val receiverDeferred = CompletableDeferred<ReceiveChannel<RequestFrame>?>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ internal class RSocketResponderImpl(

//TODO single collect
val request = flow {
val strategy = coroutineContext.requestStrategy()
val strategy = currentCoroutineContext().requestStrategy()
val initialRequest = strategy.firstRequest()
send(RequestNFrame(streamId, initialRequest))
collectStream(streamId, receiver, strategy, this)
Expand Down

0 comments on commit b53b1a9

Please sign in to comment.