invoke(methodName, ...args) {
        const [streams, streamIds] = this._replaceStreamingParams(args);
        const invocationDescriptor = this._createInvocation(methodName, args, false, streamIds);
        const p = new Promise((resolve, reject) => {
            // invocationId will always have a value for a non-blocking invocation
            this._callbacks[invocationDescriptor.invocationId] = (invocationEvent, error) => {
                if (error) {
                    reject(error);
                    return;
                }
                else if (invocationEvent) {
                    // invocationEvent will not be null when an error is not passed to the callback
                    if (invocationEvent.type === _IHubProtocol__WEBPACK_IMPORTED_MODULE_3__.MessageType.Completion) {
                        if (invocationEvent.error) {
                            reject(new Error(invocationEvent.error));
                        }
                        else {
                            resolve(invocationEvent.result);
                        }
                    }
                    else {
                        reject(new Error(`Unexpected message type: ${invocationEvent.type}`));
                    }
                }
            };
            const promiseQueue = this._sendWithProtocol(invocationDescriptor)
                .catch((e) => {
                reject(e);
                // invocationId will always have a value for a non-blocking invocation
                delete this._callbacks[invocationDescriptor.invocationId];
            });
            this._launchStreams(streams, promiseQueue);
        });
        return p;
    }
/** Invokes a hub method on the server using the specified name and arguments.
     *
     * The Promise returned by this method resolves when the server indicates it has finished invoking the method. When the promise
     * resolves, the server has finished invoking the method. If the server method returns a result, it is produced as the result of
     * resolving the Promise.
     *
     * @typeparam T The expected return type.
     * @param {string} methodName The name of the server method to invoke.
     * @param {any[]} args The arguments used to invoke the server method.
     * @returns {Promise<T>} A Promise that resolves with the result of the server method (if any), or rejects with an error.
     */
Invokes a hub method on the server using the specified name and arguments.
The Promise returned by this method resolves when the server indicates it has finished invoking the method. When the promise
resolves, the server has finished invoking the method. If the server method returns a result, it is produced as the result of
resolving the Promise.

@typeparam T The expected return type.
@param {string} methodName The name of the server method to invoke.
@param {any[]} args The arguments used to invoke the server method.
@returns {Promise} A Promise that resolves with the result of the server method (if any), or rejects with an error.
Invokes a hub method on the server using the specified name and arguments . The Promise returned by this method resolves when the server indicates it has finished invoking the method . When the promise resolves the server has finished invoking the method . If the server method returns a result it is produced as the result of resolving the Promise . @typeparam T The expected return type . @param { string } methodName The name of the server method to invoke . @param { any [] } args The arguments used to invoke the server method . @returns { Promise } A Promise that resolves with the result of the server method ( if any ) or rejects with an error .
invoke(methodName, ...args) {
        const [streams, streamIds] = this._replaceStreamingParams(args);
        const invocationDescriptor = this._createInvocation(methodName, args, false, streamIds);
        const p = new Promise((resolve, reject) => {
            this._callbacks[invocationDescriptor.invocationId] = (invocationEvent, error) => {
                if (error) {
                    reject(error);
                    return;
                }
                else if (invocationEvent) {
                    if (invocationEvent.type === _IHubProtocol__WEBPACK_IMPORTED_MODULE_3__.MessageType.Completion) {
                        if (invocationEvent.error) {
                            reject(new Error(invocationEvent.error));
                        }
                        else {
                            resolve(invocationEvent.result);
                        }
                    }
                    else {
                        reject(new Error(`Unexpected message type: ${invocationEvent.type}`));
                    }
                }
            };
            const promiseQueue = this._sendWithProtocol(invocationDescriptor)
                .catch((e) => {
                reject(e);
                delete this._callbacks[invocationDescriptor.invocationId];
            });
            this._launchStreams(streams, promiseQueue);
        });
        return p;
    }
invoke ( methodName , ... args ) { const [ streams , streamIds ] = this . _replaceStreamingParams ( args ) ; const invocationDescriptor = this . _createInvocation ( methodName , args , false , streamIds ) ; const p = new Promise ( ( resolve , reject ) => { this . _callbacks [ invocationDescriptor . invocationId ] = ( invocationEvent , error ) => { if ( error ) { reject ( error ) ; return ; } else if ( invocationEvent ) { if ( invocationEvent . type === _IHubProtocol__WEBPACK_IMPORTED_MODULE_3__ . MessageType . Completion ) { if ( invocationEvent . error ) { reject ( new Error ( invocationEvent . error ) ) ; } else { resolve ( invocationEvent . result ) ; } } else { reject ( new Error ( ` ${ invocationEvent . type } ` ) ) ; } } } ; const promiseQueue = this . _sendWithProtocol ( invocationDescriptor ) . catch ( ( e ) => { reject ( e ) ; delete this . _callbacks [ invocationDescriptor . invocationId ] ; } ) ; this . _launchStreams ( streams , promiseQueue ) ; } ) ; return p ; }
Invokes a hub method on the server using the specified name and arguments.
Invokes a hub method on the server using the specified name and arguments .
// invocationId will always have a value for a non-blocking invocation // invocationEvent will not be null when an error is not passed to the callback // invocationId will always have a value for a non-blocking invocation