| 81 | } |
| 82 | |
| 83 | open(restPath: string, query: Query, accessor: IDataAccessor, |
| 84 | descriptor: IDataDescriptor<DataType>, webSocketClient: WebSocketClient) { |
| 85 | this.restPath = restPath; |
| 86 | this.query = query; |
| 87 | this.accessor = accessor; |
| 88 | this.webSocketClient = webSocketClient; |
| 89 | this.socketPath = socketPath(this.restPath); |
| 90 | this.endpoint = endpointPath(this.restPath); |
| 91 | this.socketPathRE = socketPathRE(this.socketPath); |
| 92 | this.queryExecutor = new DataQuery(this.query); |
| 93 | this.descriptor = descriptor; |
| 94 | |
| 95 | webSocketClient.eventStream.subscribe(this.listener.bind(this)); |
| 96 | this.accessor.registerCollection(this); |
| 97 | this.isOpen = true; |
| 98 | } |
| 99 | |
| 100 | close() { |
| 101 | if (this.isOpen) { |