Class: Bosh::Director::TaskResultFile
- Defined in:
- lib/bosh/director/task_result_file.rb
Instance Method Summary collapse
-
#initialize(file_name) ⇒ TaskResultFile
constructor
A new instance of TaskResultFile.
- #write(result) ⇒ Object
Constructor Details
#initialize(file_name) ⇒ TaskResultFile
Returns a new instance of TaskResultFile.
3 4 5 6 |
# File 'lib/bosh/director/task_result_file.rb', line 3 def initialize(file_name) @file = File.open(file_name, 'w') @lock = Mutex.new end |
Instance Method Details
#write(result) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/bosh/director/task_result_file.rb', line 8 def write(result) @lock.synchronize do @file.write(result) @file.flush end end |