How to use the fast-azure-storage.Queue function in fast-azure-storage

To help you get started, we’ve selected a few fast-azure-storage 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 / taskcluster / services / queue / src / queueservice.js View on Github external
assert(/^[A-Za-z0-9][A-Za-z0-9-]*$/.test(options.prefix), 'Invalid prefix');
    assert(options.prefix.length <= 6,  'Prefix is too long');
    assert(options.resolvedQueue,       'A resolvedQueue name must be given');
    assert(options.claimQueue,          'A claimQueue name must be given');
    assert(options.deadlineQueue,       'A deadlineQueue name must be given');
    assert(options.monitor,             'A monitor instance must be given');
    options = _.defaults({}, options, {
      pendingPollTimeout:    5 * 60 * 1000,
      deadlineDelay:        10 * 60 * 1000,
    });

    this.prefix             = options.prefix;
    this.pendingPollTimeout = options.pendingPollTimeout;
    this.monitor            = options.monitor;

    this.client = new azure.Queue({
      accountId:    options.credentials.accountName,
      accessKey:    options.credentials.accountKey,
      timeout:      AZURE_QUEUE_TIMEOUT,
    });

    // Store account name of use in SAS signed Urls
    this.accountName = options.credentials.accountName;

    // Promises that queues are created, return mapping from priority to
    // azure queue names.
    this.queues = {};

    // Resets queues cache every 25 hours, this ensures that meta-data is kept
    // up-to-date with a last_used field no more than 48 hours behind
    setInterval(() => {this.queues = {};}, 25 * 60 * 60 * 1000);
github taskcluster / taskcluster / services / queue / src / queueservice.js View on Github external
assert(options.prefix.length <= 6, 'Prefix is too long');
    assert(options.resolvedQueue, 'A resolvedQueue name must be given');
    assert(options.claimQueue, 'A claimQueue name must be given');
    assert(options.deadlineQueue, 'A deadlineQueue name must be given');
    assert(options.monitor, 'A monitor instance must be given');
    options = _.defaults({}, options, {
      deadlineDelay: 10 * 60 * 1000,
    });

    this.prefix = options.prefix;
    this.monitor = options.monitor;

    if (options.credentials.fake) {
      this.client = new FakeQueueClient();
    } else {
      this.client = new azure.Queue({
        accountId: options.credentials.accountId,
        accessKey: options.credentials.accessKey,
        timeout: AZURE_QUEUE_TIMEOUT,
      });
    }

    // Store account name of use in SAS signed Urls
    this.accountId = options.credentials.accountId;

    // Promises that queues are created, return mapping from priority to
    // azure queue names.
    this.queues = {};

    // Resets queues cache every 25 hours, this ensures that meta-data is kept
    // up-to-date with a last_used field no more than 48 hours behind
    this.queueResetInterval = setInterval(() => {this.queues = {};}, 25 * 60 * 60 * 1000);

fast-azure-storage

Fast client library for azure storage services

MPL-2.0
Latest version published 11 months ago

Package Health Score

77 / 100
Full package analysis

Similar packages