USE OF ACTION
-
While fetching data using
let json_req = {
correlationID: "abcde12345",
action: 0,
mode: 3,
exchangeType: data.exchanger === "NFO" ? 2 : 4,
tokens: marketToken[data.index],
};WebSocketV2response.fetchData(json_req);
WebSocketV2response.on("tick", async (response) => {
});code what's the use of action (i.e. 0 and 1) ?
-
@Moderator_2
I mean when i provide 1 then i get data continuously but when i provide 0 then i receive pong as a data.I want to receive data once or few seconds later for what i have requested but while providing 1 it is giving me the same data continuously for what i have requested.
How can i receive data with some latency so that i can computing on present value of data and again i request or by itself after few seconds or minutes it should fetch data using fetchData function ?
THANK YOU
-
Hi @greatworld
Action param on Websocket request represents zero to unsubscribe and one to subscribe the scripts.
Regards,
SmartAPI team