Last active
July 3, 2018 11:49
-
-
Save AlexDaSoul/0ff81cd05f01c35f50923c5324e28d70 to your computer and use it in GitHub Desktop.
ws-9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// объект конфигурации WebSocketSubject | |
private config: WebSocketSubjectConfig<IWsMessage<any>>; | |
private websocketSub: SubscriptionLike; | |
private statusSub: SubscriptionLike; | |
// Observable для реконнекта по interval | |
private reconnection$: Observable<number>; | |
private websocket$: WebSocketSubject<IWsMessage<any>>; | |
// сообщает, когда происходит коннект и реконнект | |
private connection$: Observer<boolean>; | |
// вспомогательный Observable для работы с подписками на сообщения | |
private wsMessages$: Subject<IWsMessage<any>>; | |
// пауза между попытками реконнекта в милисекундах | |
private reconnectInterval: number; | |
// количество попыток реконнекта | |
private reconnectAttempts: number; | |
// синхронный вспомогатель для статуса соединения | |
private isConnected: boolean; | |
// статус соединения | |
public status: Observable<boolean>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment