How to use the taskcluster-client.Scheduler function in taskcluster-client

To help you get started, we’ve selected a few taskcluster-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github taskcluster / mozilla-taskcluster / src / treeherder / job_handler.js View on Github external
constructor(config, listener) {
    this.config = config;
    this.queue = new Queue();
    this.scheduler = new Scheduler();

    this.prefix = config.treeherderTaskcluster.routePrefix;
    this.listener = listener;

    // Treeherder project instances used for posting job details to treeherder
    this.projects = {}

    listener.on('message', (message) => {
      return this.handleTaskEvent(message);
    });

    // Pending pushes per repository...
    this._pendingPushes = {
      /**
      example: {
        active: false,
github taskcluster / taskcluster / services / github / bin / worker.js View on Github external
cfg.get('influx:connectionString'),
      cfg.get('influx:maxDelay'),
      cfg.get('influx:maxPendingPoints')
    );
  } catch(e) {
    debug("Missing influx_connectionStraing: stats collection disabled.");
    var statsDrain = common.stdoutStatsDrain;
  }

  // For use in validation of taskcluster github config files
  let validator = await common.buildValidator(cfg);

  // Create a single connection to the GithubAPI to pass around
  var githubAPI = new Octokat(cfg.get('github:credentials'));

  var scheduler = new taskcluster.Scheduler(cfg.get('taskcluster'));

  // A context to be passed into message handlers
  let context = {cfg, githubAPI, scheduler, validator};

  // Start monitoring the process
  base.stats.startProcessUsageReporting({
    drain:      statsDrain,
    component:  cfg.get('taskclusterGithub:statsComponent'),
    process:    'worker'
  });

  let pulseCredentials = cfg.get('pulse')
  assert(pulseCredentials.username, 'Username must be supplied for pulse connection');
  assert(pulseCredentials.password, 'Password must be supplied for pulse connection');

  var webHookListener = new taskcluster.PulseListener({