Implementing JSON-RPC with SwiftNIO
summary
Implements JSON-RPC over TCP using SwiftNIO with a three-stage pipeline: JSON framing (delimiter \r\n), Foundation Codable encode/decode, and a request/response handler that queues promises to correlate calls and replies. Shows how framing uses a delimiter, how errors surface on decode, and that the client gets a future fulfilled on response. Demo controls four light bulbs via JSON-RPC and the commands successfully turn them on and off.
AI-written summary · about
chapters (20)
- 0:00Introduction
- 0:50Network Protocols
- 3:30SwiftNIO
- 4:50SwiftNIO Ecosystem
- 5:30Key abstractions
- 6:15What is JSONRPC
- 6:45JSONRPC Example
- 7:10SwiftNIO Components
- 7:40Client Pipeline
- 8:10Request Handler
- 9:55Next Handler
- 10:30Frame
- 11:45Wait
- 12:20Decode
- 13:15Server Pipeline
- 13:45Server Handler
- 14:05Request
- 15:00Callback
- 15:35demo
- 16:40links








