-
Notifications
You must be signed in to change notification settings - Fork 185
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
Allow futures on Serve and Stub to be Send #448
base: master
Are you sure you want to change the base?
Conversation
Sorry for the delay in reviewing! Will try to look in the next week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a reasonable change to me. Doesn't Serve need to be made a trait variant, too? Also, could you add some tests demonstrating how it will work for users?
@@ -66,6 +68,27 @@ impl Config { | |||
} | |||
} | |||
|
|||
/// A [`Stub`] implementation that simply warps a `Serve`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: typo
/// A [`Stub`] implementation that simply warps a `Serve`. | |
/// A [`Stub`] implementation that simply wraps a `Serve`. |
@@ -66,6 +68,27 @@ impl Config { | |||
} | |||
} | |||
|
|||
/// A [`Stub`] implementation that simply warps a `Serve`. | |||
pub struct ServeStub<S> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe keep this type private for now and return an imp Stub? Can always make it public later if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea
Perfect, that's what I was looking for by putting up an early draft.
Probably, was just focusing on my use case a little too much 😅
Will do, as I mentioned this is an early draft to make sure the change makes sense. |
I'll get back to this in a day or so, thanks for the review! |
304be66
to
7f6f351
Compare
Haven't forgotten, just wrapped up in other stuff. I'll try to get to it soon! |
Looks like Also, how do you feel about renaming Serve and Stub to LocalServe and LocalStub so that the "default" type is |
I've given it some more thought and I'm wondering if the right move is to instead have a feature flag that annotates all traits with async methods in them with |
Not sure if this approach is the right one, so this MR is a draft.