From Juan Hernandez <juan.hernandez(a)redhat.com>:
Juan Hernandez has submitted this change and it was merged.
Change subject: Add support for asynchronous requests
......................................................................
Add support for asynchronous requests
This patch modifies the SDK so that it uses the 'multi' interface of the
'libcurl' library. This interface supports several advanced HTTP
capabilities, like multiple connections and pipelining.
The interface of the SDK is preserved, for backwards compatibility. The
only new addition is a new 'wait' parameter, for all operations. The
default value is 'true'. When the values is 'false' the operation is
performed asynchronously, and a 'future' object is returned that can be
used to retrieve the result later. For example:
# Find the virtual machine and the service that manages it:
vm = vms_service.list(search='name=myvm')[0]
vm_service = vms_service.vm_service(vm.id)
# Find the disk attachments, asynchronously:
attachments_service = vm_service.disk_attachments_service
attachments_future = attachments_service.list(wait: false)
# Do some other tasks, for example sending some more asynchronous
# requests, so that they are queued and potentially pipelined.
# Later, wait for the result:
attachments = attachments_future.wait
# Print the details:
attachments.each do |attachment|
puts attachment.disk.id
end
Change-Id: I8b004247ea79357eae768535fb3caf871329daf8
Signed-off-by: Juan Hernandez <juan.hernandez(a)redhat.com>
(cherry picked from commit e900aeac320508ad4ee01ab559e699369567042f)
---
M generator/src/main/java/org/ovirt/sdk/ruby/RubyBuffer.java
M generator/src/main/java/org/ovirt/sdk/ruby/RubyNames.java
M generator/src/main/java/org/ovirt/sdk/ruby/ServicesGenerator.java
M sdk/ext/ovirtsdk4c/ov_http_client.c
M sdk/ext/ovirtsdk4c/ov_http_client.h
A sdk/ext/ovirtsdk4c/ov_http_transfer.c
A sdk/ext/ovirtsdk4c/ov_http_transfer.h
A sdk/ext/ovirtsdk4c/ov_string.c
A sdk/ext/ovirtsdk4c/ov_string.h
M sdk/ext/ovirtsdk4c/ovirtsdk4c.c
M sdk/lib/ovirtsdk4/connection.rb
M sdk/lib/ovirtsdk4/probe.rb
M sdk/lib/ovirtsdk4/service.rb
M sdk/lib/ovirtsdk4/writer.rb
M sdk/spec/connection_use_spec.rb
M sdk/spec/service_spec.rb
16 files changed, 1,156 insertions(+), 635 deletions(-)
Approvals:
Juan Hernandez: Verified; Looks good to me, approved
Jenkins CI: Passed CI tests
--
To view, visit
https://gerrit.ovirt.org/74540
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I8b004247ea79357eae768535fb3caf871329daf8
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-sdk-ruby
Gerrit-Branch: sdk_4.1
Gerrit-Owner: Juan Hernandez <juan.hernandez(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>