[suggestion] Events listening timeout in Client CLI
Feature request
I'd like to have the ability to listen to events with a given timeout. I see the function signature in this way:
pub fn listen_for_events(
&self,
event_filter: FilterBox,
timeout: Option<Duration>, // time after which the connection will be closed
) -> Result<impl Iterator<Item = Result<Event>>> {
Motivation
Currently, the client library doesn't provide a way to listen to events with some specific timeout.
Who can help?
@Erigara @appetrosyan
seems to work for asynchronous methods, but not synchronous
The problem seems to be that submit_transaction_blocking internally uses listen_for_events and never times out if transaction has been rejected before being stored in a block. I think that if transaction is rejected during validation it is store in the block and submit_transaction_blocking will not hang in that case. We have to cover cases where transaction is eagerly dropped