fcm-rust
fcm-rust copied to clipboard
Switch to Actix (awc)
Switch to using a recent version of awc on an actix_rt
Realistically, I plan on using this with an actix deployment, there is no reason to use hyper or reqwest.
One of the focuses of #24 was compile time, a cargo clean && cargo build --release --example simple_sender
took
Compiling awc v3.0.0-beta.18
Compiling fcm v0.9.1 (/Users/jwtrueb/Desktop/workspace/fcm-rust)
Finished release [optimized] target(s) in 38.60s
and a cargo clean && cargo build --release --example simple_sender --features openssl
Compiling awc v3.0.0-beta.18
Compiling fcm v0.9.1 (/Users/jwtrueb/Desktop/workspace/fcm-rust)
Finished release [optimized] target(s) in 41.38s
Here are the some of the features available on awc
[package.metadata.docs.rs]
# features that docs.rs will build with
features = ["openssl", "rustls", "compress-brotli", "compress-gzip", "compress-zstd", "cookies"]
[features]
default = ["compress-brotli", "compress-gzip", "compress-zstd", "cookies"]
# openssl
openssl = ["tls-openssl", "actix-tls/openssl"]
# rustls
rustls = ["tls-rustls", "actix-tls/rustls"]
I set the default feature rustls
, since we need SSL
You might want to break out the features and choose reqwest, hyper, awc, and tls based on features instead of using this PR.