Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A Concurrent HTTP/2 Server with Ractor

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

A Concurrent HTTP/2 Server with Ractor

Avatar for thekuwayama

thekuwayama

April 22, 2026

More Decks by thekuwayama

Other Decks in Programming

Transcript

  1. About HTTP/2 (1) - Hypertext Transfer Protocol (HTTP), referred to

    as HTTP version 2 - 2015 RFC 7540 - 2022 RFC 9113 - Protocol designed for efficient transfer
  2. About HTTP/2 (2) - Streams and Multiplexing - multiple concurrent

    exchanges on the same connection - HPACK dynamic tables - one for compressing HTTP headers, and another for static and one for dynamic tables
  3. HPACK Index Header Name Header Value 1 :authority 2 :method

    GET … … … 61 www-authenticate 62 … … … … … static table dynamic table By (re)using index, shortens encoding
  4. About Ractor - most objects are unshareable objects - Ractor.make_shareable

    - Ractor.shareable_proc - message-passing for unshareable objects - Ractor#send - Ractor.recv
  5. About HTTP/2 (2) - Streams and Multiplexing - multiple concurrent

    exchanges on the same connection - HPACK dynamic tables - one for compressing HTTP headers, and another for static and one for dynamic tables
  6. Connection Stream Stream … new new new Socket HPACK::Encoder, Deocder

    rx Ractor::Port rx Ractor::Port tx Ractor::Port
  7. Connection Stream Stream … new new new Socket HPACK::Encoder, Deocder

    rx Ractor::Port rx Ractor::Port tx Ractor::Port
  8. Conclusion - Developing an HTTP/2 server with Ractor - https://github.com/thekuwayama/biryani

    - universally used HTTP/2 protocol - I hope this helps solve the chicken-and-egg problem at Ractor.