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

Migrate value constants to configuration #138

Open
1 of 5 tasks
Bathtor opened this issue Feb 14, 2021 · 0 comments
Open
1 of 5 tasks

Migrate value constants to configuration #138

Bathtor opened this issue Feb 14, 2021 · 0 comments
Assignees
Milestone

Comments

@Bathtor
Copy link
Contributor

Bathtor commented Feb 14, 2021

We currently have a lot of internal constants or default parameters that are deep within components and modules and are difficult or impossible to change, certainly after compilation.

We should migrate as many as possible of these to use our HOCON configuration, so that users can actually customise their instances without having to recompile.

In order to do so, I think we should have a mechanism to produce hierarchical keys internally that is compile time evaluated. I'm imagining something like pub const MY_KEY: &str = config_key!(PARENT_KEY, "my-key"), which we then expose in the docs (gotta make sure these modules are always public) with explanations of what the key does. Perhaps we could even let the macro generate the rust-doc as well.
I tried something like this with just simple concat!(), but that doesn't let me use constants. So maybe we need to use something like the const_format crate.

Status

  1. Decide on key mechanism (@Bathtor completed in Configuration Entry Mechanism #145 )
  2. Convert configuration parameters (@adamhass )

Must Convert

  • dispatch::lookup::gc::defaults
  • buffer config (at least top level and network level, individual components might be trickier)
  • blocklist/allowlist

This list is woefully incomplete. Please edit whenever you find something that should be here.

@Bathtor Bathtor added this to the 1.0.0 milestone Feb 14, 2021
@Bathtor Bathtor self-assigned this Feb 14, 2021
@Bathtor Bathtor assigned adamhass and unassigned Bathtor Mar 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants