Skip to content

Commit

Permalink
remove deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
menshibin committed Nov 1, 2024
1 parent ee2dfbb commit fddf41d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 78 deletions.
53 changes: 0 additions & 53 deletions nodejs/src/client/wsClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,59 +141,6 @@ export class WsClient {

}

// async fetch(res: WSQueryResponse): Promise<WSFetchResponse> {
// let fetchMsg = {
// action: 'fetch',
// args: {
// req_id: ReqId.getReqID(),
// id: res.id,
// },
// };
// return new Promise((resolve, reject) => {
// let jsonStr = JSONBig.stringify(fetchMsg);
// logger.debug('[wsQueryInterface.fetch.fetchMsg]===>' + jsonStr);
// if (this._wsConnector && this._wsConnector.readyState() > 0) {
// this._wsConnector.sendMsg(jsonStr).then((e: any) => {
// if (e.msg.code == 0) {
// resolve(new WSFetchResponse(e));
// } else {
// reject(new WebSocketInterfaceError(e.msg.code, e.msg.message));
// }
// }).catch((e) => {reject(e);});
// } else {
// reject(new TDWebSocketClientError(ErrorCode.ERR_CONNECTION_CLOSED, "invalid websocket connect"));
// }

// });
// }

// async fetchBlock(fetchResponse: WSFetchResponse, taosResult: TaosResult): Promise<TaosResult> {
// let fetchBlockMsg = {
// action: 'fetch_block',
// args: {
// req_id: ReqId.getReqID(),
// id: fetchResponse.id,
// },
// };

// return new Promise((resolve, reject) => {
// let jsonStr = JSONBig.stringify(fetchBlockMsg);
// logger.debug("[wsQueryInterface.fetchBlock.fetchBlockMsg]===>" + jsonStr)
// if (this._wsConnector && this._wsConnector.readyState() > 0) {
// this._wsConnector.sendMsg(jsonStr).then((e: any) => {
// let resp:MessageResp = e
// taosResult.addTotalTime(resp.totalTime)
// // if retrieve JSON then reject with message
// // else is binary , so parse raw block to TaosResult
// parseBlock(new WSFetchBlockResponse(resp.msg), taosResult)
// resolve(taosResult);
// }).catch((e) => reject(e));
// } else {
// reject(new TDWebSocketClientError(ErrorCode.ERR_CONNECTION_CLOSED, "invalid websocket connect"));
// }
// });
// }

async sendMsg(msg:string): Promise<any> {
return new Promise((resolve, reject) => {
logger.debug("[wsQueryInterface.sendMsg]===>" + msg)
Expand Down
25 changes: 0 additions & 25 deletions nodejs/src/client/wsResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,31 +61,6 @@ export class WSQueryResponse {
}
}

// export class WSFetchResponse {
// code: number;
// message: string;
// action: string;
// req_id: number;
// timing: bigint;
// id: bigint;
// completed: boolean;
// length: Array<number>;
// rows: number;
// totalTime: number;
// constructor(resp:MessageResp) {
// this.totalTime = resp.totalTime
// this.code = resp.msg.code;
// this.message = resp.msg.message;
// this.action = resp.msg.action;
// this.req_id = resp.msg.req_id;
// this.timing = BigInt(resp.msg.timing);
// this.id = BigInt(resp.msg.id);
// this.completed = resp.msg.completed;
// this.length = resp.msg.length;
// this.rows = resp.msg.rows;
// }
// }

export class WSFetchBlockResponse {
data: DataView | undefined
action: bigint
Expand Down

0 comments on commit fddf41d

Please sign in to comment.