RegisteredWatcher

Last updated 28 days ago

Registered watcher objects are plain objects with a few convenience methods and properties. These objects can only be obtained via the .watchers.add method (for the time being), and all watcher management is done through the interface they provide. If watcher management (e.g pausing, resuming, removing, updating) is required by an application, they should be saved in the app's state.

Properties

  • source (Object): A replica of the object provided to .watchers.add.

  • state (Object): An object representing the current state of the registered watcher.

    • active (boolean): Represents whether computer vision processes are active for the watcher in question. Changed by pause and resume methods.

  • onClassification (Function): Configurable handler for the classification event. See Watcher for details.

  • onLocation (Function, Optional): Configurable handler for the location event. See Watcher for details.

Methods

Note that all of these methods return a promise with no resolve value.

pause()

Pauses computer vision activity (classification, location) for the registered watcher.

resume()

Resumes computer vision activity (classification, location) for the registered watcher.

remove()

Removes the registered watcher.

Notes

Adding and removing watchers can have an impact on performance. If you intend to reuse the same watcher, consider using the pause and resume methods instead.

Replaces the shape of a registered watcher with the new one provided.