Taming WebSocket with Scarlet
summary
Scarlet is an extensible Kotlin library that turns Android WebSocket integration into a declarative interface and cuts boilerplate down to 10 lines of code. It uses an OkHttp plugin for transport, supports Moshi/Protobuf serialization and RxJava Flowable or coroutines, and embeds a backoff strategy plus lifecycle-aware connect/disconnect. Tinder moves from 2s polling that yields 90% empty responses to persistent push, and Scarlet’s immutable state machine makes retries, tests and protocol extensions (SSE, Socket.IO, MQTT in v2) predictable.
AI-written summary · about
chapters (8)
- 0:00Introduction and motivation
- 7:00Why switch to WebSocket
- 13:28Challenges with WebSocket
- 20:05Introducing Scarlet library
- 24:05Scarlet’s modular design
- 33:48Scarlet’s predictable code
- 38:30Scarlet’s future and V2
- 42:48Q&A








