-
Notifications
You must be signed in to change notification settings - Fork 818
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
Feature Proposal: optionloader for Kitex client/server #1330
Comments
I want to try to solve this issue. |
Please prepare a detailed tech plan. |
@felix021 Define the core interface:
The following is the sample code
The above is just a simple interface abstraction. Is there anything else you need to add? |
Sorry for the late reply. This proposal is already claimed by @Printemps417 and I forgot to update the asignee. |
I have been following this issue for some time. How is it going? May I join it? |
@BaiZe1998 The previous student's implementation has merit, but still needs more complete details. We can discuss it together. |
Hi, we have completed most implementations of the optionloader for yml, etcd, and consul, which is being developed in this repository: https://github.com/Printemps417/optionloader. I'm glad we can exchange ideas and learn from each other. |
Currently Kitex users have to manually intialize a client/server with options, for example:
If there's a need to change the options, one has to modify the code and recompile it, which is no doubt tedious work.
In this proposal, we suggest implementing a library
optionloader
for loading options from certain source (e.g. some local yaml file), which is capable of loading frequently used options out-of-the-box, and is also extensible by allowing users to register config-to-option translators without modify the library itself.With this library, users will be able to initialize a client (or server) this way:
Note: the above is just pseudo code to show the core concept, and is not strict stardard for final design. For example, some user may prefer a default value (other than the default value in Kitex) when a config item does not appear in the yaml file.
To make this library handier, it's preferably better to support more config sources like etcd/consul, and also the translation for
callopt.Option
,streamclient.Option
andstreamcall.Option
.This library shall be released under https://github.com/kitex-contrib .
If you are interested in implementing this feature, please kindly prepare a detailed tech plan and reply with your lark id for us.
The text was updated successfully, but these errors were encountered: