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

avoid Arc for already Send-able Services #5

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

dpc
Copy link
Contributor

@dpc dpc commented Aug 23, 2023

Re #4

The exact API is up for the debate. One one arcing internally makes things a bit easier for the user. On the other - I would expect most of real use will require internal Arcing of stuff anyway, and could just avoid an extra dereference.

I don't have strong opinions, and just wanted to confirm if it's possible in the first place. The Pin stuff made me worried for a bit.

@ibraheemdev
Copy link
Owner

I would prefer inverting the API just for ease of use, and the fact that the Arc is unlikely to be a huge bottleneck for most people. So something serve and serve_clone (where serve defers to serve_clone(Arc::new(s)).

@dpc dpc force-pushed the avoid-arc branch 2 times, most recently from b45672f to 6028417 Compare September 8, 2023 19:26
src/server.rs Outdated Show resolved Hide resolved
@ibraheemdev
Copy link
Owner

Perfect, thanks!

@ibraheemdev ibraheemdev merged commit fdbe92b into ibraheemdev:master Sep 8, 2023
5 checks passed
@ibraheemdev
Copy link
Owner

Released in 0.3.0.

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.

2 participants