Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Simplify use of SendTransactionService #10999

Merged
merged 5 commits into from
Jul 11, 2020
Merged

Conversation

garious
Copy link
Contributor

@garious garious commented Jul 10, 2020

Problem

Our services typically communicate with channels. By using channels, we can easily swap out what's on the other end. In the case of something upstream from SendTransactionService, it's sometimes useful to swap out SendTransactionService for something that doesn't require a UDP socket.

Summary of Changes

Refactor SendTransactionService to send transactions after receiving them instead of just before sending. This allows us to remove the send() method and expose the Receiver<TransactionInfo> directly. Upstream users of the service then no longer need to hold the object unless they intend to call join() on it. Instead, pass the upstream a Sender<TransactionInfo>, which may or may not have a SendTransactionService on the other end.

garious added 2 commits July 10, 2020 16:31
This will allow us to move the channel to the public interface
@garious garious requested a review from mvines July 10, 2020 22:39
core/src/rpc.rs Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jul 11, 2020

Codecov Report

Merging #10999 into master will increase coverage by 0.0%.
The diff coverage is 91.8%.

@@           Coverage Diff           @@
##           master   #10999   +/-   ##
=======================================
  Coverage    82.2%    82.2%           
=======================================
  Files         318      318           
  Lines       72870    72866    -4     
=======================================
+ Hits        59914    59931   +17     
+ Misses      12956    12935   -21     

@garious garious added the automerge Merge this Pull Request automatically once CI passes label Jul 11, 2020
@mergify mergify bot merged commit 1459061 into solana-labs:master Jul 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants