How to use the @azure/core-amqp.Constants.defaultPrefetchCount function in @azure/core-amqp

To help you get started, we’ve selected a few @azure/core-amqp 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 / eventHubReceiver.ts View on Github external
const linkCreationConfig: RetryConfig = {
        connectionId: this._context.connectionId,
        connectionHost: this._context.config.host,
        operation: () => this.initialize(initOptions),
        operationType: RetryOperationType.receiverLink,
        retryOptions: {
          maxRetries: Constants.defaultMaxRetriesForConnection,
          retryDelayInMs: 15000
        }
      };

      await retry(linkCreationConfig);

      // if the receiver is in streaming mode we need to add credits again.
      if (this._isStreaming) {
        this._addCredit(Constants.defaultPrefetchCount);
      }
    } catch (err) {
      logger.verbose(
        "[%s] An error occurred while processing onDetached() of Receiver '%s' with address " +
          "'%s': %O",
        this._context.connectionId,
        this.name,
        this.address,
        err
      );
    }
  }
github Azure / azure-sdk-for-js / sdk / eventhub / event-hubs / src / receiver.ts View on Github external
// close this receiver when user triggers a cancellation.
        this.close().catch(() => {}); // no-op close error handler
      }
      onError(error);
    };

    const onAbort = () => {
      if (this._baseConsumer) {
        this._baseConsumer.abort();
      }
    };

    baseConsumer.registerHandlers(
      onMessage,
      wrappedOnError,
      Constants.defaultPrefetchCount,
      true,
      abortSignal,
      onAbort
    );

    if (
      this._receiverOptions.trackLastEnqueuedEventProperties &&
      this._baseConsumer &&
      this._baseConsumer.runtimeInfo
    ) {
      this._lastEnqueuedEventProperties = this._baseConsumer.runtimeInfo;
    }

    return new ReceiveHandler(baseConsumer);
  }