~/talk

The Knights Who Say NIO: SwiftNIO in Depth

Talkat AltConf 2019 · 2019-06-03..06-06· [swift, networking]
name:Jon Shier
links:none on file
slides:none on file

Built a working MQTT broker on SwiftNIO using channels, pipelines, and event loop groups, with a ByteToMessageDecoder/encoder for MQTT’s fixed header and remaining-length parsing, and tests run via EmbeddedChannel decoder verifier. Core data uses ByteBuffer copy-on-write to avoid allocations; published messages use an encode-once outbound optimization to reuse one encoded buffer for thousands of subscribers. Implementation compiles, passes parser tests, and took about 40 hours; enterprise brokers can scale to ~10 million connections.

AI-written summary · about

  1. 0:00Intro
  2. 0:15MQTT
  3. 2:02MQTT Packet Structure
  4. 3:20Ping Packet Structure
  5. 4:31What is SwiftNIO
  6. 5:26Event Loops
  7. 7:36Channel
  8. 8:40Pipeline
  9. 9:40Channel Handler Protocol
  10. 10:36Channel Outbound Inbound Events
  11. 12:23Channel Handler Context
  12. 13:19What is NIO
  13. 14:30bytebuffer
  14. 15:52bytebuffer implementation
  15. 17:08channelread implementation
  16. 19:32bytemessage decoder
  17. 22:42bootstrap
  18. 24:58plan
  19. 26:09packet decoder
  20. 29:26parsing packets
  21. 31:17packet encoder
  22. 33:29outbound optimisation
  23. 35:17NIO tests
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.