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

feat: make chunk size user defined #388

Closed
wants to merge 1 commit into from
Closed

Conversation

joshuef
Copy link
Contributor

@joshuef joshuef commented Sep 25, 2024

BEAKING CHANGE: all APIs updated to have min/max_encryptrable bytes passed in by the user.

This allows for varying the use of the lib.

BEAKING CHANGE: all APIs updated to have min/max_encryptrable bytes
passed in by the user.

This allows for varying the use of the lib.
Copy link
Member

@maqi maqi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a general question that, to miniumn the impact of the change, why not make CHUNK_SIZE configurable via env ?
something like :

lazy_static! {
    static ref MAX_CHUNK_SIZE: usize = std::env::var("MAX_CHUNK_SIZE")
            .unwrap_or("1048576".to_string())
            .parse::<usize>()
            .unwrap_or(1048576);
}

with that, the change can then be non breaking and be totally backward compatible.

On calling side, there will be no need to change any production code, just a setup configuration for each devnet.

@b-zee
Copy link
Contributor

b-zee commented Sep 25, 2024

make CHUNK_SIZE configurable via env

Good idea, but it's possible to use without lazy_static! with std::option_env! (https://doc.rust-lang.org/std/macro.option_env.html)

@maqi
Copy link
Member

maqi commented Sep 25, 2024

Good idea, but it's possible to use without lazy_static! with std::option_env!

lazy_static! is still required to construct only once during run time ?

meanwhile, I do agree using std::option_env will be better to avoid pollution during run_time env

@joshuef
Copy link
Contributor Author

joshuef commented Sep 26, 2024

Okay as suggested, closing in favor of: #389

@joshuef joshuef closed this Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants