* Start the client subscription loop. * This controls the connection lifecycle independently from request lifecycle.
(options?: { restart?: boolean })
| 1091 | * This controls the connection lifecycle independently from request lifecycle. |
| 1092 | */ |
| 1093 | subscribe(options?: { restart?: boolean }): void { |
| 1094 | const restart = options?.restart === true |
| 1095 | if (this.isSubscribed && !restart) { |
| 1096 | return |
| 1097 | } |
| 1098 | |
| 1099 | if (this.isSubscribed && restart) { |
| 1100 | this.abortSubscriptionLoop() |
| 1101 | } |
| 1102 | |
| 1103 | this.setIsSubscribed(true) |
| 1104 | this.setConnectionStatus('connecting') |
| 1105 | this.startSubscription() |
| 1106 | } |
| 1107 | |
| 1108 | /** |
| 1109 | * Unsubscribe and fully tear down live behavior. |
no test coverage detected