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

ReequestManager makes requests #19

Merged
merged 9 commits into from Apr 19, 2019

Conversation

hannahhoward
Copy link
Collaborator

Goals

Build a request manager that can send requests out to the network

Implementation

Similar to bitswap:

  • Build a message queue to manage sending messages to a single peer
  • Build a peer manager to track open connections, and manage delegating messages to the appropriate queue

Then:

  • Add some test infrastructure for various types of failed selectors
  • Add the RequestManager:
    • RequestManager receives a request, and returns a response channel and an error channel
    • RequestManager serializes request out to the network
    • ResponseCollector buffers responses and errors so RequestManager doesn't block even if the peer itself does not read from the channel
    • RequestManager processes errors with selectors specs and sends them out on error channel
    • RequestManager reads responses sent back and blocks, for now, and only temporarily, transmits all blocks to all peers
    • RequestManager transmits failure response codes from peers as errors
    • RequestManager closes response channel once a terminal response is received

NOT INCLUDED:

For Discussion

So, there's a wall of code in this PR and I could use suggestions on how to make it more easily reviewable

fix #5

@hannahhoward hannahhoward added this to Needs review in go-graphsync Mar 16, 2019
@hannahhoward hannahhoward force-pushed the chore/request-manager-makes-requests-5 branch from 290fdb0 to 6bf65e5 Compare March 20, 2019 18:55
Create a message queue to pool messages for a single peer and send them
Create a peer manager to manage message queues for peers
Provide selectors that will fail validation or encoding
Create a manager for outgoing requests
Add a channel of asynchronous errors instead of only an initial synchronous one
Cleanup request manager test to extract repeated code
Handle failed request status codes from server and pass on errors
Update to the latest architecture, remove private vars

fix #5
@hannahhoward hannahhoward force-pushed the chore/request-manager-makes-requests-5 branch from 6bf65e5 to 38ef657 Compare April 19, 2019 00:52
@hannahhoward hannahhoward merged commit 9e172f4 into master Apr 19, 2019
go-graphsync automation moved this from Needs review to Done Apr 19, 2019
@mvdan mvdan deleted the chore/request-manager-makes-requests-5 branch December 15, 2021 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
go-graphsync
  
Done
Development

Successfully merging this pull request may close these issues.

Chore: RequestManager can send requests out to the network
1 participant