Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (28 sloc) 1.13 KB

« Documentation Home

Batch Class

Batch objects facilitate grouping multiple API calls into a single batch request. Most library methods accept a Batch object as an optional first parameter.

Properties

Methods

Constructor

Batch objects are instantiated using Graph.createBatch.

var batch = graph.createBatch();

Properties

requests

Array Batch.requests

An array of the batched requests. It is used internally by library methods, and it should be not be necessary to edit manually. NEVER reassign this property. For example: batch.requests = []; will break the batch system.

Methods

run

Batch.run ( )
Batch.run ( Function errorHandler )

Runs all requests associated with the Batch object in a single API request.

errorHandler

  • If provided, this function will be called in case of an error. If no error handler is provided, callbacks associated with each individual request will all be called with the error. Signature: Function ( error )