Taming Websocket with Scarlet
summary
Claims that WebSocket integration drops to 10 lines of code, implemented as a Retrofit-like Kotlin library called Scarlet that uses OkHttp WebSocket and a plugin system for message adapters (Moshi, protobuf), stream adapters (RxJava Flowable, coroutines), lifecycle and retry strategies. Shows concrete API: three annotated interface methods for subscribe/open/receive, a state-machine DSL for connection states, mockwebserver support for integration tests, production use at Tinder for six months across chat, match and typing features.
AI-written summary · about
chapters (25)
- 0:00Taming WebSocket with Scarlet
- 2:18WebSocket vs REST
- 2:53Bitcoin Trading
- 4:56GDAX Ticker REST API
- 6:11Polling GDAX Ticker
- 7:01GDAX Ticker WebSocket API
- 7:27What's wrong with WebSocket?
- 9:01Why Scarlet?
- 10:04Getting Started with Scarlet
- 14:29Scarlet Plugins
- 16:51WebSocketFactory (Roadmap)
- 18:22StreamAdapterFactory (Roadmap)
- 18:44Maintaining Scarlet
- 18:57Supporting API Changes
- 19:37Changing WebSocket Implementation
- 19:48Changing JSON Library
- 20:01Supporting Kotlin Coroutine
- 20:28Scarlet Reliability
- 20:56WebSocket on Android
- 23:24State Management in Scarlet
- 24:15What makes Scarlet testable?
- 24:48State Machine DSL
- 26:35Testing State Machine
- 26:55State Machine in Scarlet
- 27:27State Management Plugins








