Fix a couple of examples in the README

This commit is contained in:
Nick Thomas
2011-11-13 20:57:28 +00:00
parent 3f8b74005d
commit 25fa6d2cbe

6
README
View File

@@ -29,10 +29,6 @@ Usage example:
api.command('eject', 'device' => 'ide1-cd0') {|m| puts "CDROM ejected" }
api.query("status") {|m| puts "VM status now: #{m.inspect}" }
msg = my_own_magic_builder_method(arg1, arg2)
api.send_message(msg) {|m| puts m.inspect }
result = api.sync_send_message(msg) # Blocks until a response comes back
api.wait # Blocks until no commands or queries are outstanding.
api.command('quit') # Specifying a callback is optional
@@ -49,7 +45,7 @@ You can also do this perfectly safely:
end
end
sleep(0.1) while api.nil?
sleep(0.1) while api_outer.nil?
# do stuff with the api object
stopq.push(:ok)