-
Notifications
You must be signed in to change notification settings - Fork 14
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
Creates new stream connection when an address is in the "neighbours" list #28
Conversation
@Gilthoniel made the changes as discussed. You may want to first have a look at this test in order to check the logic: |
mino/minogrpc/traffic.go
Outdated
context string | ||
} | ||
|
||
func (p item) String() string { |
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.
Could we define the String
function to be a debug/log function that is minimalistic and one-liner (because %v
is using it) and define a Display(io.Writer)
function (in encoding for instance) that displays all the details like below ? So you can simply do item.Display(os.Stdout)
?
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.
yes, good idea
@nkcr I don't know if the mesh/routing tables are temporary and you planned to improve this later so if that's the case, you can ignore the comments related to it. |
Yes the routing/mesh structs are only temporary solutions. I agree this should be done in a per request fashion. |
A later job would be to have a deterministic flag to allow that kind of checking
We keep .String() for short printing
Creates new stream connection when an address is in the "neighbours" list
Now instead of always asking the orchestrator to relay messages, each server has a routing table and a "mesh" list, which is a list of server it must create a connection to. The routing table tells a server that doesn't have a direct connection to a peer which peer it can contact to relay that message.
I also implemented an optional way of saving all the trafic in a server. This is convenient in the tests to check that everything went well. It also provides interesting insights on how things work.