code: function listenTask(callback) {
      setTimeout(poll, poll_timeout);
      var cont = true;
      function poll() {
        database.serialize(function() {
          var predicate = "(datetime('now') >= datetime("+table_name+".at, '-"+pre_poll+" seconds')) "
          +"AND disabled = 'FALSE'";
  
          var selection_new = "SELECT * FROM "+table_name+" WHERE "+predicate;
  
          var update_selection = "UPDATE "+table_name
          +" SET at = datetime('now', '+"+default_timeout+" seconds')"
          +" WHERE ("+table_name+".id = ?) AND "+predicate;
  
        log.debug('sqlite-adapter','Running query:',selection_new);
          database.all(selection_new, function(error, rows) {
            if (error) {
              callback(error);
            }
            if (rows) {
              rows.forEach(function (row) {
                log.debug('sqlite-adapter','Running query:',update_selection);
                database.run(update_selection, row.id, function(error) {
                  if (this.changes) {
                    task = JSON.parse(row.task);
                    task.at = new Date(row.at);
                    // task.first_run = task.first_run ? task.first_run : task.at;
                    task.id = row.id;
                    callback(error, task);
                  }
                });
              });
            }
            if (cont) setTimeout(poll, poll_timeout);
          });
  
        });
      }
      return function(callback) {
        cont = false;
        if (callback) callback();
      };
    }
docs: /*
  Starts polling the database for tasks with an expired timestamp
  that are not disabled. The provided callback is called only after
  the expiry time of the task is updated if it still satisfied the
  original query predicate. Callback is called wirha JSON object for
  each row returned by the query. Each task is updated before the callback
  with their database id, row id, current timestamp and first_run time. On
  error the callback is called with an error object The function also
  exports a mechanism to stop the polling function, which takes an optional
  callback. This function does not provide rollback.