dis+/node_modules/@google-cloud/pubsub/build/src/v1/subscriber_client.js
/**
     * Pulls messages from the server. The server may return `UNAVAILABLE` if
     * there are too many concurrent pull requests pending for the given
     * subscription.
     *
     * @param {Object} request
     *   The request object that will be sent.
     * @param {string} request.subscription
     *   Required. The subscription from which messages should be pulled.
     *   Format is `projects/{project}/subscriptions/{sub}`.
     * @param {boolean} [request.returnImmediately]
     *   Optional. If this field set to true, the system will respond immediately
     *   even if it there are no messages available to return in the `Pull`
     *   response. Otherwise, the system may wait (for a bounded amount of time)
     *   until at least one message is available, rather than returning no messages.
     *   Warning: setting this field to `true` is discouraged because it adversely
     *   impacts the performance of `Pull` operations. We recommend that users do
     *   not set this field.
     * @param {number} request.maxMessages
     *   Required. The maximum number of messages to return for this request. Must
     *   be a positive integer. The Pub/Sub system may return fewer than the number
     *   specified.
     * @param {object} [options]
     *   Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
     * @returns {Promise} - The promise which resolves to an array.
     *   The first element of the array is an object representing [PullResponse]{@link google.pubsub.v1.PullResponse}.
     *   Please see the
     *   [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods)
     *   for more details and examples.
     * @example
     * const [response] = await client.pull(request);
     */
Pulls messages from the server. The server may return `UNAVAILABLE` if
there are too many concurrent pull requests pending for the given
subscription.

@param {Object} request
The request object that will be sent.
Pulls messages from the server . The server may return ` UNAVAILABLE ` if there are too many concurrent pull requests pending for the given subscription . @param { Object } request The request object that will be sent .
pull(request, optionsOrCallback, callback) {
        request = request || {};
        let options;
        if (typeof optionsOrCallback === 'function' && callback === undefined) {
            callback = optionsOrCallback;
            options = {};
        }
        else {
            options = optionsOrCallback;
        }
        options = options || {};
        options.otherArgs = options.otherArgs || {};
        options.otherArgs.headers = options.otherArgs.headers || {};
        options.otherArgs.headers['x-goog-request-params'] =
            gax.routingHeader.fromParams({
                subscription: request.subscription || '',
            });
        this.initialize();
        return this.innerApiCalls.pull(request, options, callback);
    }
pull ( request , optionsOrCallback , callback ) { request = request || { } ; let options ; if ( typeof optionsOrCallback === 'function' && callback === undefined ) { callback = optionsOrCallback ; options = { } ; } else { options = optionsOrCallback ; } options = options || { } ; options . otherArgs = options . otherArgs || { } ; options . otherArgs . headers = options . otherArgs . headers || { } ; options . otherArgs . headers [ 'x-goog-request-params' ] = gax . routingHeader . fromParams ( { subscription : request . subscription || '' , } ) ; this . initialize ( ) ; return this . innerApiCalls . pull ( request , options , callback ) ; }
Pulls messages from the server.
Pulls messages from the server .