summaryrefslogtreecommitdiff
path: root/lib/hyperstack/state.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/hyperstack/state.rb')
-rw-r--r--lib/hyperstack/state.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/hyperstack/state.rb b/lib/hyperstack/state.rb
index 0ce2687..a52b057 100644
--- a/lib/hyperstack/state.rb
+++ b/lib/hyperstack/state.rb
@@ -53,5 +53,12 @@ module HyperstackVM
@mutex.synchronize { @delegate.print("#{@prefix}#{line}") }
end
end
+
+ def flush
+ return if @buffer.empty?
+
+ @mutex.synchronize { @delegate.print("#{@prefix}#{@buffer}") }
+ @buffer = +''
+ end
end
end