Move flush_buffers method in Runner::Connection
This commit is contained in:
@ -78,6 +78,11 @@ class Runner::Connection
|
|||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def flush_buffers
|
||||||
|
@stdout_callback.call @stdout_buffer.flush unless @stdout_buffer.empty?
|
||||||
|
@stderr_callback.call @stderr_buffer.flush unless @stderr_buffer.empty?
|
||||||
|
end
|
||||||
|
|
||||||
# === WebSocket Callbacks
|
# === WebSocket Callbacks
|
||||||
# These callbacks are executed based on events indicated by Faye WebSockets and are
|
# These callbacks are executed based on events indicated by Faye WebSockets and are
|
||||||
# independent of the JSON specification that is used within the WebSocket once established.
|
# independent of the JSON specification that is used within the WebSocket once established.
|
||||||
@ -162,10 +167,4 @@ class Runner::Connection
|
|||||||
def handle_timeout(_event)
|
def handle_timeout(_event)
|
||||||
@status = :timeout
|
@status = :timeout
|
||||||
end
|
end
|
||||||
|
|
||||||
def flush_buffers
|
|
||||||
@stdout_callback.call @stdout_buffer.flush unless @stdout_buffer.empty?
|
|
||||||
@stderr_callback.call @stderr_buffer.flush unless @stderr_buffer.empty?
|
|
||||||
end
|
|
||||||
private :flush_buffers
|
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user