Class: PollingStrategy

VisSense.VisMon.Strategy. PollingStrategy

A strategy that will periodically update the objects visibility state.

new PollingStrategy(config)

Parameters:
Name Type Argument Default Description
config VisSense.VisMon.Strategy.PollingStrategy#PollingStrategyConfig <optional>
{interval:1000}

The config object

Properties:
Name Type Description
_config VisSense.VisMon.Strategy.PollingStrategy#PollingStrategyConfig

The internal config object

Example
var visMon = VisSense(...).monitor({
  strategy: new VisSense.VisMon.Strategy.PollingStrategy({
    interval: 5000
  }),
  update: function() {
    console.log('updated.');
  }
}).start();

Extends

Methods

init(monitor)

The init method is called when a monitor is created and has not started yet.

Parameters:
Name Type Description
monitor VisSense.VisMon
Inherited From:

start(monitor)

Parameters:
Name Type Description
monitor VisSense.VisMon

stop(monitor)

Parameters:
Name Type Description
monitor VisSense.VisMon

Type Definitions

PollingStrategyConfig

A configuration object to configure a PollingStrategy instance.

Type:
  • Object
Properties:
Name Type Argument Default Description
interval number <optional>
5000

The interval between state updates in milliseconds.