Method: RbVmomi::VIM::ManagedObject#wait_until
- Defined in:
- lib/rbvmomi/vim/ManagedObject.rb
#wait_until(*pathSet) { ... } ⇒ Object
TODO:
Pass the current property values to the block.
Wait for updates on an object until a condition becomes true.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/rbvmomi/vim/ManagedObject.rb', line 12 def wait_until *pathSet, &b all = pathSet.empty? filter = _connection.propertyCollector.CreateFilter :spec => { :propSet => [{ :type => self.class.wsdl_name, :all => all, :pathSet => pathSet }], :objectSet => [{ :obj => self }], }, :partialUpdates => false ver = '' loop do result = _connection.propertyCollector.WaitForUpdates(:version => ver) ver = result.version if x = b.call return x end end ensure filter.DestroyPropertyFilter if filter end |