Closed wxf4150 closed 1 month ago
with above code; only the ETH stream data can work.
createCallbackClient can used for cancel server-side stream.
let cccli = createCallbackClient(PubService, transport) let cancel = cccli.greet({str: "bob"}, res => { console.log(res); }, () => { }) cancel() cancel = cccli.greet({str: "jim"}, res => { console.log(res); }, () => { })
const client = createPromiseClient(PubService, transport);
let stream=client.tickerChan({str:"ETH"}); for await (const i of stream) { console.log("abc eth",new Date(), i) }; // stream.close(); //should be call here. stream=client.tickerChan({str:"BTC"}); for await (const i of stream) { console.log("abc btc",new Date(), i) };