Class: Plum::ServerConnection
- Inherits:
-
Connection
- Object
- Connection
- Plum::ServerConnection
- Defined in:
- lib/plum/server/connection.rb
Direct Known Subclasses
Constant Summary
Constants inherited from Connection
Connection::CLIENT_CONNECTION_PREFACE, Connection::DEFAULT_SETTINGS
Instance Attribute Summary
Attributes inherited from Connection
#hpack_decoder, #hpack_encoder, #local_settings, #remote_settings, #state, #streams
Attributes included from FlowControl
#recv_remaining_window, #send_remaining_window
Instance Method Summary collapse
-
#initialize(writer, local_settings = {}) ⇒ ServerConnection
constructor
A new instance of ServerConnection.
-
#reserve_stream(**args) ⇒ Object
Reserves a new stream to server push.
Methods inherited from Connection
Methods included from ConnectionUtils
#goaway, #ping, #push_enabled?, #settings
Methods included from FlowControl
Methods included from EventEmitter
Constructor Details
#initialize(writer, local_settings = {}) ⇒ ServerConnection
Returns a new instance of ServerConnection.
5 6 7 8 9 |
# File 'lib/plum/server/connection.rb', line 5 def initialize(writer, local_settings = {}) super(writer, local_settings) @state = :waiting_preface end |
Instance Method Details
#reserve_stream(**args) ⇒ Object
Reserves a new stream to server push.
13 14 15 16 17 18 19 |
# File 'lib/plum/server/connection.rb', line 13 def reserve_stream(**args) next_id = @max_stream_ids[0] + 2 stream = stream(next_id) stream.set_state(:reserved_local) stream.update_dependency(**args) stream end |