class Async::HTTP::Protocol::HTTP2::Stream::Buffer
def send_data(chunk, maximum_size)
-
stream
(Stream
) -- the stream to use for sending data frames. -
maximum_size
(Integer
) -- send up to this many bytes of data.
def send_data(chunk, maximum_size) if chunk.bytesize <= maximum_size @stream.send_data(chunk, maximum_size: maximum_size) else @stream.send_data(chunk.byteslice(0, maximum_size), maximum_size: maximum_size) # The window was not big enough to send all the data, so we save it for next time: self.push( chunk.byteslice(maximum_size, chunk.bytesize - maximum_size) ) end end