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

issue#325 #354

Conversation

adigunhammedolalekan
Copy link

Hi, please check the PR and see if the requirement is satisfied

@@ -14,7 +14,7 @@ type Message interface {
// Service is an interface that represents a networking service (ideally p2p) that we can use to send messages or listen to incoming messages
type Service interface {
Start() error
RegisterProtocol(protocol string) chan Message
RegisterProtocol(protocol string, bufferSize int) chan Message
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would rather you pass the chan into RegisterProtocol
all places using RegisterProtocol should be changed accordingly

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't get that, pass the chan into RegisterProtocol()

Did you mean like changing RegisterProtocol signature to accept chan as parameter?
Something like RegisterProtocol(name, chan Message)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes thats right

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @adigunhammedolalekan are you planning to fix this ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adigunhammedolalekan hi, nice work with the pr but you left this part out
can you fix this so we can merge ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! I'll really love to, but can you please provide a little bit more details? I'll really appreciate that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't get that, pass the chan into RegisterProtocol()

Did you mean like changing RegisterProtocol signature to accept chan as parameter?
Something like RegisterProtocol(name, chan Message)

you need to change RegisterProtocol like we discussed and refactor the places it is used so the tests still pass.
so basically the only thing to do is change RegisterProtocol(protocol string, bufferSize int) chan Message to RegisterProtocol(protocol string, chan Message)
of course that means that you will have to create and pass the chan when calling RegisterProtocol.

@almogdepaz
Copy link
Contributor

almogdepaz commented Dec 23, 2018

hi @adigunhammedolalekan thanks for the pull request, looks good!
i commented on relevant parts, also notice your changes are breaking some of the tests please make sure none of the tests are failing

@adigunhammedolalekan
Copy link
Author

Thanks @almogdepaz

I'll fix that ASAP

@antonlerner
Copy link
Contributor

Hi @adigunhammedolalekan
Please fix tidy checks and re run tests so we can move along and try merge your fix

@adigunhammedolalekan
Copy link
Author

Hi, @antonlerner i have been trying to fix the test issue, i will fix it as soon as possible.

Thanks

@adigunhammedolalekan
Copy link
Author

@antonlerner @almogdepaz

@@ -191,7 +192,7 @@ func (sn *Node) SubscribePeerEvents() (chan crypto.PublicKey, chan crypto.Public

// RegisterProtocol creates and returns a channel for a given protocol.
func (sn *Node) RegisterProtocol(protocol string) chan Message {
c := make(chan Message)
c := make(chan Message, config.ConfigValues.BufferSize)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to change RegisterProtocol like we discussed and refactor the places it is used so the tests still pass.
so basically the only thing to do is change RegisterProtocol(protocol string, bufferSize int) chan Message to RegisterProtocol(protocol string, chan Message)
of course that means that you will have to create and pass the chan when calling RegisterProtocol.

@antonlerner
Copy link
Contributor

closed due to lack of activity

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.

None yet

3 participants