0.0.1 • Published 8 years ago

kibana-executor-service v0.0.1

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
8 years ago

kibana-executor-service

A periodical executor service for Kibana

Install

npm install kibana-executor-service

Requirements

  • Kibana 4.4+

Example Usage

import modules from 'ui/modules';
import 'kibana-executor-service';
var app = modules.get('app/example', ['kibana/executor']);

app.controller('exampleController', function ($executor, timefilter, $scope, $http) {
  timefilter.enabled = true;
  
  $executor.register({
    execute: () => {
      // Do some periodic task like hit an HTTP api endpoint
      $http.get('/something/very/cool');
    },
    handleResponse: (resp) => {
      // Sweet dude!
    },
    handleError: (err) => {
      // Oops!
    }
  });

  // Start the executor
  $executor.start();

  // Destory the executor
  $scope.$on('$destroy', $executor.destroy);

});