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

Uniform middleware for both Server and Client #10

Open
soygul opened this issue Dec 27, 2015 · 1 comment
Open

Uniform middleware for both Server and Client #10

soygul opened this issue Dec 27, 2015 · 1 comment

Comments

@soygul
Copy link
Member

soygul commented Dec 27, 2015

No matter Server or Client is triggering our middleware.go handlers, json-rpc layer is nothing but another middleware layer on raw Neptulon TCP. Due to this, we should make everything target middleware.go for incoming and sender.go for outgoing stuff.

Sender needs access to a single Conn.Write function, which could be provided as an interface during NewSender and this interface could be implemented/embedded in both Client/Server just as we did with the middleware.go

Note: Should backport this idea to Neptulon.

@soygul
Copy link
Member Author

soygul commented Dec 29, 2015

Note: sender.go can't be exact uniform as Server will always require a ConnID to know which connection to send the message though but Client will always use the underlying client connection so won't need it.

On the other hand, at Neptulon level, sender.go can be responsible for keeping a list of connections to send the message though so can remove that function from server.go.

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

No branches or pull requests

1 participant