How to use the @azure/abort-controller.AbortController function in @azure/abort-controller

To help you get started, we’ve selected a few @azure/abort-controller 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 Azure / azure-sdk-for-js / sdk / eventhub / event-hubs / src / partitionPump.ts View on Github external
constructor(
    eventHubClient: EventHubClient,
    partitionProcessor: PartitionProcessor,
    private readonly _originalInitialEventPosition: EventPosition | undefined,
    options: FullEventProcessorOptions
  ) {
    this._eventHubClient = eventHubClient;
    this._partitionProcessor = partitionProcessor;
    this._processorOptions = options;
    this._abortController = new AbortController();
  }
github Azure / azure-sdk-for-js / sdk / eventhub / event-hubs / src / eventProcessor.ts View on Github external
start(): void {
    if (this._isRunning) {
      logger.verbose(`[${this._id}] Attempted to start an already running EventProcessor.`);
      return;
    }

    this._isRunning = true;
    this._abortController = new AbortController();
    logger.verbose(`[${this._id}] Starting an EventProcessor.`);

    if (targetWithoutOwnership(this._processingTarget)) {
      logger.verbose(`[${this._id}] Single partition target: ${this._processingTarget}`);
      this._loopTask = this._runLoopWithoutLoadBalancing(this._processingTarget);
    } else {
      logger.verbose(`[${this._id}] Multiple partitions, using load balancer`);
      this._loopTask = this._runLoopWithLoadBalancing(
        this._processingTarget,
        this._abortController.signal
      );
    }
  }

@azure/abort-controller

Microsoft Azure SDK for JavaScript - Aborter

MIT
Latest version published 8 months ago

Package Health Score

82 / 100
Full package analysis