Skip to content

Commit

Permalink
Merge pull request #47 from rikitikitaco/backpressure
Browse files Browse the repository at this point in the history
add onBackpressureBuffer to Connection.kt
  • Loading branch information
zhxnlai authored Jan 17, 2019
2 parents d2d0909 + 0b12586 commit 5457f82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import okio.ByteString
internal class OkHttpWebSocketEventObserver : WebSocketListener() {
private val processor = PublishProcessor.create<WebSocket.Event>().toSerialized()

fun observe(): Flowable<WebSocket.Event> = processor
fun observe(): Flowable<WebSocket.Event> = processor.onBackpressureBuffer()

fun terminate() = processor.onComplete()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ internal class Connection(
}
}

fun observeEvent(): Flowable<Event> = eventProcessor
fun observeEvent(): Flowable<Event> = eventProcessor.onBackpressureBuffer()

fun subscribe() {
lifecycle.subscribe(lifecycleStateSubscriber)
Expand Down

0 comments on commit 5457f82

Please sign in to comment.