Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Native prices: Implement generic buffered batching system 1/3 (#2869)
# Description Implements a generic batching system for the native prices. The implementation has a blocking function `blocking_buffered_estimate_prices()` that belongs to a struct which runs a thread. The thread gathers the requests either by time (it waits X time to gather request and then fires them) or by number of requests (as soon ass it reaches a number of requests, fires them). This generic implementation allow for any native price fetcher to batch buffer the request as long as they implement the trait `NativePriceBatchFetcher`. This code is heavily based on the `ethrpc` crate code. In the upcoming PR: - the configuration will be propagated to the services configuration - implement the trait `NativePriceBatchFetcher` for CoinGecko # Changes - Generic buffered batching system for native prices ## How to test 1. Unit test --------- Co-authored-by: MartinquaXD <[email protected]>
- Loading branch information