Conversation
0cdf8a5 to
4efba82
Compare
| to_block: u64, | ||
| event_channels: &HashMap<String, mpsc::Sender<Log>>, | ||
| ) -> anyhow::Result<()> { | ||
| for event_filter in &self.tracked_events { |
There was a problem hiding this comment.
Can each of event process be done in parallel?
If you're not sure, feel free to just create an issue to track parallel processing feature, we can handle that later
There was a problem hiding this comment.
I believe this is what this is achieving. The basic flow is:
- Create a mapping between event --> channel
- Create background process per event.
- Blocks are processed as a single thread, the events are sent to their resepcitve channels / threads
- Each thread independently calls their respective callbacks
There was a problem hiding this comment.
Blocks are processed as a single thread, the events are sent to their resepcitve channels / threads
Isn't this function fetching events separately for each event filter? Meaning, if you have 3 event filters, it would invoke 3 different fetch requests for the same block range?
0xNeshi
left a comment
There was a problem hiding this comment.
Approving in advance, the remaining open discussion can continue despite merging.
If a change becomes necessary, we should create an issue and address it in a separate PR.
Solves #9