Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

dylanlott
Copy link
Contributor

@dylanlott dylanlott commented Mar 17, 2025

  • 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.

Closes ENG-792

@dylanlott dylanlott force-pushed the 03-07-updates_the_tx-poller_to_stream_transactions branch from 8b1ec06 to aaeb7c6 Compare March 17, 2025 18:48
@dylanlott dylanlott force-pushed the 03-07-updates_the_tx-poller_to_stream_transactions branch from aaeb7c6 to aff2cdf Compare March 19, 2025 15:59
@dylanlott dylanlott force-pushed the 03-07-updates_the_tx-poller_to_stream_transactions branch from aff2cdf to 5069931 Compare March 27, 2025 20:46
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.");
Copy link
Member

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

Copy link
Member

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.
- improves poll interval handling
- removes arcs
- updates comments
- adds file level comment
@dylanlott dylanlott force-pushed the 03-07-updates_the_tx-poller_to_stream_transactions branch from 5069931 to 1ad6e14 Compare April 3, 2025 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants