Class: RbVmomi::VIM::Task
- Inherits:
-
Object
- Object
- RbVmomi::VIM::Task
- Defined in:
- lib/rbvmomi/vim/Task.rb
Instance Method Summary collapse
-
#wait_for_completion ⇒ Object
Wait for a task to finish.
-
#wait_for_progress {|info.progress| ... } ⇒ Object
Wait for a task to finish, with progress notifications.
Instance Method Details
#wait_for_completion ⇒ Object
Wait for a task to finish.
5 6 7 8 9 10 11 12 13 |
# File 'lib/rbvmomi/vim/Task.rb', line 5 def wait_for_completion wait_until('info.state') { %w(success error).member? info.state } case info.state when 'success' info.result when 'error' raise info.error end end |
#wait_for_progress {|info.progress| ... } ⇒ Object
Wait for a task to finish, with progress notifications.
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/rbvmomi/vim/Task.rb', line 19 def wait_for_progress wait_until('info.state', 'info.progress') do yield info.progress if block_given? %w(success error).member? info.state end case info.state when 'success' info.result when 'error' raise info.error end end |