-
Notifications
You must be signed in to change notification settings - Fork 50
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
Compile -> Runtime Configuration ? #44
Comments
Regarding this topic, I recently encountered Krakex which allows passing a |
If anyone is interested to discuss about this, I made the changes in a branch on my fork : asmodehn#1 |
Just commenting to note that I was recently bit by the compile time pinning of these config values. It is very non intuitive and extremely frustrating to troubleshoot. At a minimum there should be a warning or a note in a comment in the sample config mentioning that if you change the values after the first run you will need to run |
Endpoint was getting baked in at compile-time, so changing env at runtime had no effect. Fixes #44
Endpoint was getting baked in at compile-time, so changing env at runtime had no effect. Fixes #44
Sorry for not catching this earlier. Was a simple one-line change that's causing this. I've changed it to use Application.get_env which means Application.set_env can just change it again. Next step is to pass those in dynamically, but for now this should at least resolve that issue |
Hi everyone, I am opening this issue to start a conversation regarding compiled / runtime configuration.
Few reasons for this :
adding a private function to the module where we call
Application.get_env()
, instead of a module tag would make it changeable at runtime. Although not practical it would work fine in monoprocess situations (only one configuration possible) and would allow testing different configurations.Would be better: functions need more parameters for tests (or user code) to be able to change endpoint/apikey/secret on call which will make this code usable in a multiprocess situation (one process can connect to one account, another to a different account for instance, they would crash independently, etc.).
Regarding 2., in my specific usecase, I am currently thinking to have one process for public requests, another one for authenticated requests (only this process would be started with apikey and secret). Call rates will be different, public requests can probably be cached for a short time (don't modify the real world), authenticated clients can crash and respawn independently, etc.
Adding these parameters to functions can make the API more complex, so we should think about how to do this without degrading the dev experience...
I see a couple of options:
What do you think about 1. ? I can do a quick PR, if this is something you are interested in.
What do you think about 2. ?
Also, let me know of any other issue that would be useful that would be useful to work on and fall into this "configuration" topic. I am currently working on this on my code, so I can probably contribute something similar here.
Cheers !
The text was updated successfully, but these errors were encountered: