|
|
|
@ -2,6 +2,7 @@ import { webSocket } from 'rxjs/webSocket';
|
|
|
|
|
import { of, timer, concatMap, EMPTY, takeWhile, concat } from 'rxjs';
|
|
|
|
|
import { filter, buffer, map, tap, retryWhen, retry, delay, take, catchError } from 'rxjs/operators';
|
|
|
|
|
import { v4 as uuid } from 'uuid';
|
|
|
|
|
import { logWebsocket } from '@/utils/commons';
|
|
|
|
|
|
|
|
|
|
export class RealTimeAPI {
|
|
|
|
|
constructor(param, onOpenCallback, onCloseCallback, onRetryCallback) {
|
|
|
|
@ -104,11 +105,12 @@ export class RealTimeAPI {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sendMessage(messageObject) {
|
|
|
|
|
console.log(
|
|
|
|
|
`%c websocket Message OUT ⬆`,
|
|
|
|
|
'background:#41b883 ; padding: 1px; border-radius: 3px; color: #fff',
|
|
|
|
|
JSON.stringify(messageObject),
|
|
|
|
|
);
|
|
|
|
|
// console.log(
|
|
|
|
|
// `%c websocket Message OUT ⬆`,
|
|
|
|
|
// 'background:#41b883 ; padding: 1px; border-radius: 3px; color: #fff',
|
|
|
|
|
// JSON.stringify(messageObject, null, 2),
|
|
|
|
|
// );
|
|
|
|
|
logWebsocket(messageObject, 'O');
|
|
|
|
|
this.webSocket.next(messageObject);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|