I have an Rx.Observable.webSocket object. The server endpoint cannot process messages that receive the same time (<25ms). Now I need a way to stretch the following () calls to my websocket object.
I created another Subject requestSubjectand subscribed to it. Then call the next website inside the subscription.
requestSubject.delay(1000).subscribe((request) => {
console.log(`SENDING: ${JSON.stringify(request)}`);
socketServer.next(JSON.stringify(request));
});
With the delay shift, each subsequent call gets the same delay time, then all subsequent calls issue the same time later ... this is not what I want.
I tried delay, throttle, debouncebut it is not suitable.
The following should illustrate my problem.
Stream 1 | ---1-------2-3-4-5---------6----
after some operation ...
Stream 2 | ---1-------2----3----4----5----6-
source
share