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

Sharing an ApiDescription with multiple server instances #547

Open
jgallagher opened this issue Jan 6, 2023 · 0 comments
Open

Sharing an ApiDescription with multiple server instances #547

jgallagher opened this issue Jan 6, 2023 · 0 comments

Comments

@jgallagher
Copy link
Contributor

If one wants to run the same set of endpoints in multiple servers (e.g., in the example added in #543), one awkward corner of dropshot's API is that ApiDescription is not cloneable, so it must be recreated from scratch for each server instance. A couple possibilities, neither of which is trivial to implement:

  1. We could implement Clone for ApiDescription, but it can't be derived (and many of the types that would also need to implement Clone cannot either) because doing so would require the server context to be cloneable, but that isn't actually necessary to clone the description.
  2. We could find a way to sprinkle in some Arcs to allow sharing an ApiDescription between multiple servers. It's not immediately obvious how to do this due to ApiDescription::into_router() consuming the ApiDescription.
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

1 participant