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

Review thoughts #1

Open
carllerche opened this issue Dec 13, 2018 · 2 comments
Open

Review thoughts #1

carllerche opened this issue Dec 13, 2018 · 2 comments

Comments

@carllerche
Copy link
Member

I'm working on reviewing the repository. I have not reviewed everything yet. I will track my thoughts as they come here. Actionable takeaways should be tracked in dedicated issues / PRs.

NewTransport

It seems that NewTransport is a Service of transports. Perhaps this should be represented as an "trait alias" similar to MakeService. Naming wise, right now we have MakeService, so perhaps this could be MakeTransport?

pipeline::Client

  • Can max_in_flight be removed? This should be possible to implement as a middleware.
  • Is the VecDeque of requests needed? Can these be sent directly to the transport without buffering?

pipeline::client::Maker

Should this be named MakeClient?

pipeline::Server

Same as with Client, could some fields / logic be removed in favor of using middleware to implement that logic?

Examples

It would be nice to have a client / server example using a basic line protocol so we can see how the entire stack fits together w/ Tokio and codec / framed.

@jonhoo
Copy link
Collaborator

jonhoo commented Dec 13, 2018

WIP thoughts:

I'm working on reviewing the repository. I have not reviewed everything yet. I will track my thoughts as they come here. Actionable takeaways should be tracked in dedicated issues / PRs.

NewTransport

Yup, I think NewTransport could totally be MakeTransport which is in turn a Service with particular requirements on the types.

pipeline::Client

  • Yup. max_in_flight can be removed.
  • The VecDeque is needed in case the transport start_send fails.

pipeline::client::Maker

I didn't name it MakeClient (or ClientMaker) because it's already under the client module. Wanted to try to avoid repeating names in the path. Not super wedded to that either way though.

pipeline::Server

We could probably get rid of max_in_flight here too. I find it a little weird to think about max in flight limits as middleware on the server, but should work.

Examples

There are some tests in tests/ that have examples using async-bincode, but larger examples with a full codec might also be helpful. I haven't used codec/framed before myself, but should fit in nicely.

jonhoo added a commit that referenced this issue Dec 14, 2018
jonhoo added a commit that referenced this issue Dec 14, 2018
Should be added using middleware as per #1.
@jonhoo
Copy link
Collaborator

jonhoo commented Dec 19, 2018

From some discussion: probably fine to replace the VecDequeue for requests with a single "slot" to buffer a failed start_send, and then do the send of that in poll_ready.

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

2 participants