Skip to content

Commit

Permalink
BehaviorProcessor
Browse files Browse the repository at this point in the history
  • Loading branch information
Elyniss committed Aug 2, 2022
1 parent 1a62d90 commit 934d975
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import com.tinder.scarlet.Message
import com.tinder.scarlet.ShutdownReason
import com.tinder.scarlet.WebSocket
import io.reactivex.Flowable
import io.reactivex.processors.PublishProcessor
import io.reactivex.processors.BehaviorProcessor
import okhttp3.Response
import okhttp3.WebSocketListener
import okio.ByteString

internal class OkHttpWebSocketEventObserver : WebSocketListener() {
private val processor = PublishProcessor.create<WebSocket.Event>().toSerialized()
private val processor = BehaviorProcessor.create<WebSocket.Event>().toSerialized()

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

Expand Down

0 comments on commit 934d975

Please sign in to comment.