# -*- encoding: binary -*- # Copyright (C) 2013, Eric Wong et. al. # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt) require_relative 'wbuf_common' class Yahns::WbufStr # :nodoc: include Yahns::WbufCommon def initialize(str, next_state) @str = str @next = next_state # :check_client_connection, :http_100_response end def wbuf_flush(client) case rv = client.kgio_trywrite(@str) when String @str = rv when :wait_writable, :wait_readable return rv when nil return @next end while true end end