Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

不考虑增加监听器类似的功能模块进去吗 #115

Open
shonve opened this issue Dec 12, 2023 · 1 comment
Open

不考虑增加监听器类似的功能模块进去吗 #115

shonve opened this issue Dec 12, 2023 · 1 comment

Comments

@shonve
Copy link

shonve commented Dec 12, 2023

增加类似listener监听器模块,当有新交易或者新的区块出现时进行监听回调

@endiaoekoe
Copy link
Contributor

endiaoekoe commented Dec 14, 2023

增加类似listener监听器模块,当有新交易或者新的区块出现时进行监听回调

@shonve
Good idea.
As you mentioned, in Ethereum, many clients such as web3j provide a listener module, which helps developers to listen to new tx or blocks. such as the PendingTransactionFilter object, to observe tx events and invoke the callback function to do some local logic.

On the other hand, there are some concerns that we may need to think twice about before implementing this feature. As we know, the listener needs to connect to a remote RPC endpoint/fullnode. below are some risks and considerations :
Resource Consumption: Listeners need to remain running continuously and actively monitor events on the network. This can consume system resources, including network bandwidth and computational power. If the listener runs for an extended period or handles a large number of events, it may impact the performance of the node.
Event Processing Delay: Listeners are asynchronous and rely on remote fullnode to deliver events to them. As a result, there may be some delay in processing events, and real-time event retrieval may not be achievable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants