8
8
9
9
module Protocol
10
10
module HTTP2
11
- # A single HTTP 2.0 connection can multiplex multiple streams in parallel:
11
+ # A single HTTP/2 connection can multiplex multiple streams in parallel:
12
12
# multiple requests and responses can be in flight simultaneously and stream
13
13
# data can be interleaved and prioritized.
14
14
#
@@ -18,42 +18,44 @@ module HTTP2
18
18
# diagram below) and provide your application logic to handle request
19
19
# and response processing.
20
20
#
21
- # +--------+
22
- # send PP | | recv PP
23
- # ,--------| idle |--------.
24
- # / | | \
25
- # v +--------+ v
26
- # +----------+ | +----------+
27
- # | | | send H / | |
28
- # ,------| reserved | | recv H | reserved |------.
29
- # | | (local) | | | (remote) | |
30
- # | +----------+ v +----------+ |
31
- # | | +--------+ | |
32
- # | | recv ES | | send ES | |
33
- # | send H | ,-------| open |-------. | recv H |
34
- # | | / | | \ | |
35
- # | v v +--------+ v v |
36
- # | +----------+ | +----------+ |
37
- # | | half | | | half | |
38
- # | | closed | | send R / | closed | |
39
- # | | (remote) | | recv R | (local) | |
40
- # | +----------+ | +----------+ |
41
- # | | | | |
42
- # | | send ES / | recv ES / | |
43
- # | | send R / v send R / | |
44
- # | | recv R +--------+ recv R | |
45
- # | send R / `----------->| |<-----------' send R / |
46
- # | recv R | closed | recv R |
47
- # `----------------------->| |<----------------------'
48
- # +--------+
49
- #
50
- # send: endpoint sends this frame
51
- # recv: endpoint receives this frame
52
- #
53
- # H: HEADERS frame (with implied CONTINUATIONs)
54
- # PP: PUSH_PROMISE frame (with implied CONTINUATIONs)
55
- # ES: END_STREAM flag
56
- # R: RST_STREAM frame
21
+ # ```
22
+ # ┌────────┐
23
+ # send PP │ │ recv PP
24
+ # ┌──────────┤ idle ├──────────┐
25
+ # │ │ │ │
26
+ # ▼ └───┬────┘ ▼
27
+ # ┌──────────┐ │ ┌──────────┐
28
+ # │ │ │ send H / │ │
29
+ # ┌──────┼ reserved │ │ recv H │ reserved ├──────┐
30
+ # │ │ (local) │ │ │ (remote) │ │
31
+ # │ └───┬──────┘ ▼ └──────┬───┘ │
32
+ # │ │ ┌────────┐ │ │
33
+ # │ │ recv ES │ │ send ES │ │
34
+ # │ send H │ ┌─────────┤ open ├─────────┐ │ recv H │
35
+ # │ │ │ │ │ │ │ │
36
+ # │ ▼ ▼ └───┬────┘ ▼ ▼ │
37
+ # │ ┌──────────┐ │ ┌──────────┐ │
38
+ # │ │ half │ │ │ half │ │
39
+ # │ │ closed │ │ send R / │ closed │ │
40
+ # │ │ (remote) │ │ recv R │ (local) │ │
41
+ # │ └────┬─────┘ │ └─────┬────┘ │
42
+ # │ │ │ │ │
43
+ # │ │ send ES / │ recv ES / │ │
44
+ # │ │ send R / ▼ send R / │ │
45
+ # │ │ recv R ┌────────┐ recv R │ │
46
+ # │ send R / └───────────►│ │◄───────────┘ send R / │
47
+ # │ recv R │ closed │ recv R │
48
+ # └───────────────────────►│ │◄───────────────────────┘
49
+ # └────────┘
50
+ # ```
51
+ #
52
+ # - `send`: endpoint sends this frame
53
+ # - `recv`: endpoint receives this frame
54
+ #
55
+ # - H: HEADERS frame (with implied CONTINUATIONs)
56
+ # - PP: PUSH_PROMISE frame (with implied CONTINUATIONs)
57
+ # - ES: END_STREAM flag
58
+ # - R: RST_STREAM frame
57
59
#
58
60
# State transition methods use a trailing "!".
59
61
class Stream
0 commit comments