Skip to content

Commit

Permalink
fix: clients sometimes don't receive results
Browse files Browse the repository at this point in the history
  • Loading branch information
macjuul committed Jun 25, 2023
1 parent fa21389 commit 5af1930
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,6 @@ internal class ClientHandler(
fun <T : Any> subscribe(request: OperationRequest, type: KClass<T>): Flow<T> {
val id = UUID.randomUUID().toString()

send(Subscribe(id, request))

return channelFlow {
subscriptions[id] = ActiveSubscription(
onNext = {
Expand All @@ -117,6 +115,7 @@ internal class ClientHandler(
}
)

send(Subscribe(id, request))
awaitClose()
}
}
Expand Down

0 comments on commit 5af1930

Please sign in to comment.