Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
type: FRAME_TYPES.REQUEST_N,
};
this._connection.sendOne(requestNFrame);
}
//critically, if n is 0 now, that's okay because we eagerly decremented it
if (firstRequest && n >= 0) {
firstRequest = false;
//release the initial frame we received in frame form due to map operator
subscriber.onNext(frame);
}
},
});
},
MAX_REQUEST_N,
);
const framesToPayloads = new FlowableProcessor(payloads, frame =>
this._deserializePayload(frame));
this._receivers.set(streamId, framesToPayloads);
this._requestHandler.requestChannel(framesToPayloads).subscribe({
onComplete: () => this._sendStreamComplete(streamId),
onError: error => this._sendStreamError(streamId, error.message),
onNext: payload => this._sendStreamPayload(streamId, payload),
onSubscribe: subscription => {
this._subscriptions.set(streamId, subscription);
subscription.request(frame.requestN);
},
});
}