-
Notifications
You must be signed in to change notification settings - Fork 75
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
Adapter with configuration properties by connection/listening #54
Comments
Would it be possible to solve this by instead modifying the |
Thanks, @RobDavenport ! Yeah, this could be a big candidate. The The problem is, what happens if the Regarding the adapter API, the adapter function can handle directly the correct type statically, because the adapter knows all the types it uses. The tricky part is how to pass the config through the network engine as you say (without dynamic memory if possible!). (problem 2) I had some ideas related to this feature here https://github.com/lemunozm/message-io/compare/ideas/transport_with_config. The idea is to use something like Transport::TcpWith(TcpConfig{}), for the cases you need extra configuration than the default. I am not sure if this idea obfuscates the |
Regarding problem 2. Because the |
I made an attempt to resolve this in #141 by wrapping the configuration properties in an enum as @RobDavenport suggested. Having two separate enums for connect ( The last bit cannot be statically checked, unfortunately. However, I think the code is simple enough to accept this? Also from the public API it actually is guaranteed as retrieving the adapter from the variant is an internal function. I kept the original |
I really like your implementation. This feature is great to open the door to future extensions. Thanks for your contribution to this!! |
Add an easy way to pass configuration properties to the adapter when you perform a
connect()
/listen()
:You could want to configure a specific connection with some extra properties.
Currently:
Expected:
Things to consider:
The text was updated successfully, but these errors were encountered: