pollingMixin

pollingMixin

Source:
Author:
  • ariel.wexler@vecna.com
See:

Periodic Polling Object to be mixed into Backbone Collections and Models.

The polling functionality should only be used for collections and for models that are not
part of any collections. It should not be used for a model that is a part of a collection.

Members

(static) pollTimeoutId

Source:
Properties:
Name Type Description
pollTimeoutId number

The id from when setTimeout was called to start polling.

Methods

(static) isPolling()

Source:

Returns true if the poll is active

(static) polledFetch()

Source:

By default, the polled fetching operation is routed directly
to backbone's fetch all.

(static) startPolling(pollInterval)

Source:

Starts polling Model/Collection by calling fetch every pollInterval.
Note: Each Model/Collection will only allow a singleton of polling to occur so
as not to have duplicate threads updating Model/Collection.

Parameters:
Name Type Description
pollInterval Integer

interval between each poll in ms.

(static) stopPolling()

Source:

Stops polling Model and clears all Timeouts.