Stream constructor uses the DEFLECT_ID and DEFLECT_HOST ENV_VARs#98
Stream constructor uses the DEFLECT_ID and DEFLECT_HOST ENV_VARs#98rdumusc merged 1 commit intoBlueBrain:masterfrom
Conversation
deflect/Stream.h
Outdated
| * @param host The address of the target Server instance. It can be a | ||
| * hostname like "localhost" or an IP in string format like | ||
| * "192.168.1.83". If set, the environment variable DEFLECT_HOST | ||
| * takes precedence over the given value. |
There was a problem hiding this comment.
Not sure about the precedence. Let's say a UI allows the user to enter host+port to connect to - know the app has now way of ensuring that this user-provided values are used. Imo the typical use case is that env variables provide defaults, overridable by command line args, overridable by GUI (cf. $DISPLAY, '--display' usage).
There was a problem hiding this comment.
That's a fair point. @tribal-tec argued the other way around, that ENV variables should be able to override runtime behaviour without recompiling. Maybe command line arguments should still be able to take precedence?
There was a problem hiding this comment.
Imo the default (env, argv) construction should have a different ctor. zeroeq::http::Server has the create() factory method which may return a nullptr - arguably not the most elegant way. The alternative proposed by @tribal-tec was to have the ctor throw if no entity is desired, but this requires the callee to catch - also not great.
ab46d69 to
0e2eb25
Compare
|
Updated with precedence for the programmatic arguments |
|
+1 for me |
Change Deflect streaming activation, according to BlueBrain/Deflect#98
No description provided.