google-apis-core/lib/google/apis/core/base_service.rb
def batch(options = nil)
          batch_command = BatchCommand.new(:post, Addressable::URI.parse(root_url + batch_path))
          batch_command.options = request_options.merge(options)
          apply_command_defaults(batch_command)
          begin
            start_batch(batch_command)
            yield self
          ensure
            end_batch
          end
          batch_command.execute(client)
        end
# Perform a batch request. Calls made within the block are sent in a single network
# request to the server.
#
# @example
#   service.batch do |s|
#     s.get_item(id1) do |res, err|
#       # process response for 1st call
#     end
#     # ...
#     s.get_item(idN) do |res, err|
#       # process response for Nth call
#     end
#   end
#
# @param [Hash, Google::Apis::RequestOptions] options
#  Request-specific options
# @yield [self]
# @return [void]
Perform a batch request. Calls made within the block are sent in a single network
request to the server.
Perform a batch request . Calls made within the block are sent in a single network request to the server .
def batch(options = nil)
          batch_command = BatchCommand.new(:post, Addressable::URI.parse(root_url + batch_path))
          batch_command.options = request_options.merge(options)
          apply_command_defaults(batch_command)
          begin
            start_batch(batch_command)
            yield self
          ensure
            end_batch
          end
          batch_command.execute(client)
        end
def batch ( options = nil ) batch_command = BatchCommand . new ( :post , Addressable :: URI . parse ( root_url + batch_path ) ) batch_command . options = request_options . merge ( options ) apply_command_defaults ( batch_command ) begin start_batch ( batch_command ) yield self ensure end_batch end batch_command . execute ( client ) end
Perform a batch request.
Perform a batch request .
None
void
options
options Request-specific options
options Request - specific options
]
None
example
service.batch do |s| s.get_item(id1) do |res, err| # process response for 1st call end # ... s.get_item(idN) do |res, err| # process response for Nth call end end
service . batch do |s| s . get_item ( id1 ) do |res err| # process response for 1st call end # ... s . get_item ( idN ) do |res err| # process response for Nth call end end