Open marmistrz opened 2 years ago
Can't we spawn a background task to uninstall the filter? Or maybe we shall panic in case it wasn't uninstalled (or at least display an error), wdyt?
We definitely shouldn't panic. (At least some of the) JSON-RPC API providers might simply remove unused filters, so lack of removal won't be an issue for many applications.
We could spawn a background task but then the application can't react to any errors should they happen.
This is not a trivial issue, because Rust doesn't support async drop at the moment. See https://internals.rust-lang.org/t/asynchronous-destructors/11127/26.
Meanwhile, I submitted a PR updating the docs: https://github.com/tomusdrw/rust-web3/pull/584