fix: actix actors will only start on actix_rt

This commit is contained in:
Aravinth Manivannan 2023-12-27 19:44:22 +05:30
parent ba9694b31f
commit 6d90790e58
Signed by: realaravinth
GPG key ID: F8F50389936984FF
3 changed files with 17 additions and 4 deletions

18
Cargo.lock generated
View file

@ -27,11 +27,22 @@ dependencies = [
] ]
[[package]] [[package]]
name = "actix-rt" name = "actix-macros"
version = "2.8.0" version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15265b6b8e2347670eb363c47fc8c75208b4a4994b27192f345fcbe707804f3e" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb"
dependencies = [ dependencies = [
"quote",
"syn 2.0.16",
]
[[package]]
name = "actix-rt"
version = "2.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28f32d40287d3f402ae0028a9d54bef51af15c8769492826a69d28f81893151d"
dependencies = [
"actix-macros",
"futures-core", "futures-core",
"tokio", "tokio",
] ]
@ -465,6 +476,7 @@ name = "dcache"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"actix", "actix",
"actix-rt",
"anyhow", "anyhow",
"async-stream", "async-stream",
"async-trait", "async-trait",

View file

@ -33,6 +33,7 @@ tonic = { version = "0.10.2", features = ["transport", "channel"] }
prost = "0.12.3" prost = "0.12.3"
tokio-stream = "0.1.14" tokio-stream = "0.1.14"
async-stream = "0.3.5" async-stream = "0.3.5"
actix-rt = "2.9.0"
[build-dependencies] [build-dependencies]

View file

@ -40,7 +40,7 @@ pub struct Opt {
pub cluster_size: usize, pub cluster_size: usize,
} }
#[tokio::main] #[actix_rt::main]
async fn main() -> std::io::Result<()> { async fn main() -> std::io::Result<()> {
// Setup the logger // Setup the logger
tracing_subscriber::fmt() tracing_subscriber::fmt()