You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 22, 2018. It is now read-only.
Apologies it this is not the right place to ask, but I have looked at the available documentation and could not figure out myself. I am also new to js programming.
I have two questions.
Once the api is initiated with:
const transport = new Api.Provider.Http(HttpsUrl, timeout);
const api = new Api(transport);
the browser stars doing http JSON POST requests to my remote RPC Parity server to the method net_listening every timeout seconds. Which is the correct way to destroy api to stop this polling?
the browser starts to send POST requests every second.
Upon unsubscription:
api.unsubscribe(subscriptionID)
these requests keep going on. Is this an expected behaviour? I am unsubscribing to events when unmounting react components. Ideally I would like the api to stop doing those requests in order to minimize the load and bandwidth on the Parity node.
Thank you for any help
The text was updated successfully, but these errors were encountered:
Yes, this is a big of a known issue - in the case of HTTP there is no way to determine that the node is still alive. This method for checking is horrible to say the least (also implemented the same way in other non-Parity libs). Could certainly take a re-look specifically for HTTP, possibly tracking the last call.
Apologies it this is not the right place to ask, but I have looked at the available documentation and could not figure out myself. I am also new to js programming.
I have two questions.
the browser stars doing http JSON POST requests to my remote RPC Parity server to the method
net_listening
everytimeout
seconds. Which is the correct way to destroyapi
to stop this polling?api.subscribe('eth_blockNumber', this.onNewBlockNumber)
the browser starts to send POST requests every second.
Upon unsubscription:
api.unsubscribe(subscriptionID)
these requests keep going on. Is this an expected behaviour? I am unsubscribing to events when unmounting react components. Ideally I would like the api to stop doing those requests in order to minimize the load and bandwidth on the Parity node.
Thank you for any help
The text was updated successfully, but these errors were encountered: