-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updates the tx-poller to stream transactions #60
base: main
Are you sure you want to change the base?
updates the tx-poller to stream transactions #60
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
8b1ec06
to
aaeb7c6
Compare
aaeb7c6
to
aff2cdf
Compare
aff2cdf
to
5069931
Compare
tracing::debug!(count = ?transactions.len(), "found transactions"); | ||
for tx in transactions.into_iter() { | ||
if let Err(err) = outbound.send(tx) { | ||
tracing::error!(err = ?err, "failed to send transaction - channel is dropped."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the listener for the outbound channel is dropped, we want to end this loop. that's how we propagate shutdowns in the actor model, by always exiting when the task can't send messages anymore. This ensures that segments of the program automatically clean themselves up when no longer needed. As written, the loop will continue to run forever even after all of its downstreams are gone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is also not an error case, as it's a normal part of the program lifecycle, so trace!
would be more appropriate here
- shifts the tx-poller to a more actor oriented approach by streaming transactions out of the cache. - transaction deduplication and validation is intended to be carried out by the simulator.
5069931
to
1ad6e14
Compare
is it intentional that this doesn't change the way the builder consumers the poller? no poller is spawned, the builder owns one and uses the async method to poll itself rather than letting a task poll |
Closes ENG-792