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

refactor: new ClientBuilder #113

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

carlocorradini
Copy link
Contributor

Fix #112

let (client, actor) = Client::builder().build(connection).await.unwrap();

Client::build and builder::ClientBuilder are deperecated.
I've added #[deprecated(since = "0.11.0", note = "use Client::builder() instead")] (update since if necessary)
Moreover, connection is needed only when calling subscribe or build having the advantage that the overall implementation is much simpler since there is no need for:

  • connection: Box<dyn ObjectSafeConnection>
  • impl IntoFuture for ClientBuilder {
        type Output = Result<(Client, ConnectionActor), Error>;
    
        type IntoFuture = future::Boxed<Self::Output>;
    
        fn into_future(self) -> Self::IntoFuture {
            Box::pin(self.build())
        }
    }

What do you think?

@carlocorradini
Copy link
Contributor Author

Add #[allow(deprecated)] in builder.rs or?

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.

Builder pattern naming
1 participant