iroha icon indicating copy to clipboard operation
iroha copied to clipboard

[suggestion] Events listening timeout in Client CLI

Open pesterev opened this issue 3 years ago • 2 comments

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

pesterev avatar Nov 09 '22 11:11 pesterev

seems to work for asynchronous methods, but not synchronous

mversic avatar Aug 23 '23 12:08 mversic

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

mversic avatar Oct 27 '23 10:10 mversic