Skip to content

Commit

Permalink
feat: streaming now enabled/disabled with runtime flag
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswk committed Dec 17, 2024
1 parent 5281fd1 commit f7c6aa5
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 87 deletions.
92 changes: 50 additions & 42 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 9 additions & 12 deletions server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ repository = "https://github.com/Unleash/unleash-edge"
rust-version = "1.81.0"
version = "19.6.3"

[features]
streaming = ["actix-web-lab", "eventsource-client", "tokio-stream"]

[package.metadata.wix]
upgrade-guid = "11E5D83A-3034-48BB-9A84-9F589EBD648C"
path-guid = "6F606A3B-C7E9-43EC-8B6E-91D7B74F80FC"
Expand All @@ -33,19 +30,19 @@ actix-http = "3.9.0"
actix-middleware-etag = "0.4.2"
actix-service = "2.0.2"
actix-web = { version = "4.9.0", features = ["rustls-0_23", "compress-zstd"] }
actix-web-lab = { version = "0.23.0", optional = true }
actix-web-lab = { version = "0.23.0" }
ahash = "0.8.11"
anyhow = "1.0.91"
anyhow = "1.0.94"
async-trait = "0.1.83"
aws-config = { version = "1.5.7", features = ["behavior-version-latest"] }
aws-sdk-s3 = { version = "1.57.0", features = ["behavior-version-latest"] }
aws-config = { version = "1.5.10", features = ["behavior-version-latest"] }
aws-sdk-s3 = { version = "1.65.0", features = ["behavior-version-latest"] }
base64 = "0.22.1"
chrono = { version = "0.4.38", features = ["serde"] }
chrono = { version = "0.4.39", features = ["serde"] }
cidr = "0.3.0"
clap = { version = "4.5.19", features = ["derive", "env"] }
clap = { version = "4.5.23", features = ["derive", "env"] }
clap-markdown = "0.1.4"
dashmap = "6.0.1"
eventsource-client = { version = "0.13.0", optional = true }
eventsource-client = { version = "0.13.0" }
futures = "0.3.30"
futures-core = "0.3.30"
iter_tools = "0.24.0"
Expand Down Expand Up @@ -93,12 +90,12 @@ tokio = { version = "1.42.0", features = [
"tracing",
"fs",
] }
tokio-stream = { version = "0.1.16", optional = true }
tokio-stream = { version = "0.1.17" }
tracing = { version = "0.1.40", features = ["log"] }
tracing-subscriber = { version = "0.3.18", features = ["json", "env-filter"] }
ulid = "1.1.2"
unleash-types = { version = "0.14", features = ["openapi", "hashes"] }
unleash-yggdrasil = { version = "0.14.0" }
unleash-yggdrasil = { version = "0.14.1" }
utoipa = { version = "5", features = ["actix_extras", "chrono"] }
utoipa-swagger-ui = { version = "8", features = ["actix-web"] }
[dev-dependencies]
Expand Down
2 changes: 2 additions & 0 deletions server/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ async fn build_edge(args: &EdgeArgs, app_name: &str) -> EdgeResult<EdgeInfo> {
Duration::seconds(args.features_refresh_interval_seconds.try_into().unwrap()),
persistence.clone(),
args.strict,
args.streaming,
app_name,
));
let _ = token_validator.register_tokens(args.tokens.clone()).await;
Expand Down Expand Up @@ -364,6 +365,7 @@ mod tests {
prometheus_user_id: None,
prometheus_password: None,
prometheus_username: None,
streaming: false,
};

let result = build_edge(&args, "test-app").await;
Expand Down
4 changes: 4 additions & 0 deletions server/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ pub struct EdgeArgs {
#[clap(long, env, default_value_t = false, conflicts_with = "strict")]
pub dynamic: bool,

/// If set to true. Edge connects to upstream using streaming instead of polling. Requires strict mode
#[clap(long, env, default_value_t = false, requires = "strict")]
pub streaming: bool,

/// Sets a remote write url for prometheus metrics, if this is set, prometheus metrics will be written upstream
#[clap(long, env)]
pub prometheus_remote_write_url: Option<String>,
Expand Down
Loading

0 comments on commit f7c6aa5

Please sign in to comment.