BundleExecutor

BundleExecutor

BundleExecutor stores several timers for each bundle (calls are bundled based on the options passed, each bundle has unique ID that is calculated based on field values). Each timer fires and sends a call after certain amount of time, and if a new request comes to the same bundle, the timer can be restarted.

Constructor

new BundleExecutor(bundleOptions, bundleDescriptor)

Organizes requests for an api service that requires to bundle them.

Parameters:
Name Type Description
bundleOptions BundleOptions

configures strategy this instance uses when executing bundled functions.

bundleDescriptor BundleDescriptor

the description of the bundling.

Methods

schedule(apiCall, request, callback) → {function}

Schedule a method call.

Parameters:
Name Type Description
apiCall function

the function for an API call.

request Object

the request object to be bundled with others.

callback APICallback

the callback to be called when the method finished.

Returns:
Type Description
function
  • the function to cancel the scheduled invocation.