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

feat(client): remove generic parameter for Connector #428

Merged
merged 1 commit into from
Apr 8, 2015

Conversation

seanmonstar
Copy link
Member

Closes #379

BREAKING CHANGE: For people using the default HttpConnector and Client,
everything should continue to just work. If the Client has been
used with a generic parameter, it should be removed.

However, there were some breaking changes to the internals of
NetworkConnectors. Specifically, they no longer return a
NetworkStream, but instead a Into<Box<NetworkStream + Send>>. All
implementations of NetworkStream should continue to just work,
however.

Possible breakages could come from the stricter usage of Send
throughout the Client API.

cc @Manishearth @reem

Closes #379

BREAKING CHANGE: For people using the default HttpConnector and Client,
    everything should continue to just work. If the Client has been
    used with a generic parameter, it should be removed.

    However, there were some breaking changes to the internals of
    NetworkConnectors. Specifically, they no longer return a
    NetworkStream, but instead a Into<Box<NetworkStream + Send>>. All
    implementations of NetworkStream should continue to just work,
    however.

    Possible breakages could come from the stricter usage of Send
    throughout the Client API.
@seanmonstar
Copy link
Member Author

Also cc @Byron

@reem
Copy link
Contributor

reem commented Apr 8, 2015

LGTM. The Into<Box<NetworkStream + Send>> thing is a bit weird, but it works.

@seanmonstar
Copy link
Member Author

Yea, I didn't want to Box in Request if the Stream was already boxed in Client. It works out in the end.

@reem
Copy link
Contributor

reem commented Apr 8, 2015

It's a pretty nice way to avoid double boxing in some cases.

seanmonstar added a commit that referenced this pull request Apr 8, 2015
feat(client): remove generic parameter for Connector
@seanmonstar seanmonstar merged commit 564288e into master Apr 8, 2015
@seanmonstar seanmonstar deleted the client-box branch April 8, 2015 01:26
@Byron
Copy link
Contributor

Byron commented Apr 8, 2015

Dito !
Something similar I do with BorrowMut, in case I want people to either allow me to own something, or to just borrow it mutably, without them having to care. More complexity on my side translates to more flexibility and ease of use on the client side, which is a hit I am willing to take as many benefit from it.

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.

change Client to keep connector as a Box<NetworkConnector>
3 participants