Method: Protocol::HTTP2::Connection#create_stream

Defined in:
lib/protocol/http2/connection.rb

#create_stream(id = next_stream_id, &block) ⇒ Stream

Create a stream, defaults to an outgoing stream. On the client side, we create requests.

Returns:

  • (Stream)

    the created stream.



358
359
360
361
362
363
364
# File 'lib/protocol/http2/connection.rb', line 358

def create_stream(id = next_stream_id, &block)
	if block_given?
		return yield(self, id)
	else
		return Stream.create(self, id)
	end
end