function wrap(interceptor, isResponseInterceptor) {
                        /**
                         * Submit async task for interceptors.
                         * [promise] async task itself is a promise
                         */
                        return function (promise, lock) {
                            // `this` either is interceptors.request or interceptors.response
                            var _this = this;
                            /**
                             * [interceptor].p is a lock tag which actually is a Promise object.
                             * The current fly instance will be locked when an async task be submit
                             * in interceptors.
                             */
                            if (lock !== false) {
                                _this.p = new Promise(function (resolve) {
                                    function t() {
                                        if (interceptor.p) {
                                            if (isResponseInterceptor) {
                                                if (interceptor.p !== _this.p) {
                                                    _this.p = null;
                                                    resolve();
                                                } else {
                                                    interceptor.p = _this.p = null;
                                                    resolve();
                                                }
                                            } else {
                                                interceptor.p.then(function () {
                                                    _this.p = null;
                                                    resolve();
                                                });
                                            }
                                        } else {
                                            resolve();
                                            _this.p = null;
                                        }
                                    }

                                    //promise.finally() may not be implemented in some Promise polyfill, so we don't use it at now.
                                    promise.then(t, t);
                                });
                                if (isResponseInterceptor) {
                                    //
                                    if (!interceptor.p) {
                                        interceptor.p = _this.p;
                                    }
                                }
                            }
                            if (!isResponseInterceptor) {
                                fly.t = 1;
                            }
                            return promise;
                        };
                    }
Factory to generate async task creators for interceptors.
The current fly instance will be locked when an async task be created.
Once locked, the incoming request will be added to a request queue, and the
async task will not been dequeue and performed until the fly instance is unlocked.

@param [interceptor] either is interceptors.request or interceptors.response
@param [isResponseInterceptor] whether is interceptors.response or not
@returns {Function} async task creators