Skip to content
Snippets Groups Projects
Commit f24d4784 authored by Martin Löffler's avatar Martin Löffler
Browse files

async_std main attribute

Closes #1
parent 1b711a88
Branches
No related merge requests found
Pipeline #425 passed with stage
in 2 minutes and 4 seconds
...@@ -36,6 +36,16 @@ version = "0.5.2" ...@@ -36,6 +36,16 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
[[package]]
name = "async-attributes"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "efd3d156917d94862e779f356c5acae312b08fd3121e792c857d7928c8088423"
dependencies = [
"quote 1.0.8",
"syn 1.0.56",
]
[[package]] [[package]]
name = "async-channel" name = "async-channel"
version = "1.5.1" version = "1.5.1"
...@@ -110,6 +120,7 @@ version = "1.8.0" ...@@ -110,6 +120,7 @@ version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f9f84f1280a2b436a2c77c2582602732b6c2f4321d5494d6e799e6c367859a8" checksum = "8f9f84f1280a2b436a2c77c2582602732b6c2f4321d5494d6e799e6c367859a8"
dependencies = [ dependencies = [
"async-attributes",
"async-channel", "async-channel",
"async-global-executor", "async-global-executor",
"async-io", "async-io",
......
...@@ -13,7 +13,7 @@ impl_ops = "0.1.1" ...@@ -13,7 +13,7 @@ impl_ops = "0.1.1"
ctrlc = { version = "3.0", features = ["termination"] } ctrlc = { version = "3.0", features = ["termination"] }
async-tungstenite = { version = "0.10.0", features = ["async-std-runtime"] } async-tungstenite = { version = "0.10.0", features = ["async-std-runtime"] }
rauth = { git = "https://gitlab.insrt.uk/insert/rauth" } rauth = { git = "https://gitlab.insrt.uk/insert/rauth" }
async-std = { version = "1.8.0", features = ["tokio02"] } async-std = { version = "1.8.0", features = ["tokio02", "attributes"] }
hive_pubsub = { version = "0.4.3", features = ["mongo"] } hive_pubsub = { version = "0.4.3", features = ["mongo"] }
rocket_cors = { git = "https://github.com/lawliet89/rocket_cors", branch = "master" } rocket_cors = { git = "https://github.com/lawliet89/rocket_cors", branch = "master" }
......
...@@ -18,17 +18,13 @@ pub mod notifications; ...@@ -18,17 +18,13 @@ pub mod notifications;
pub mod routes; pub mod routes;
pub mod util; pub mod util;
use async_std::task;
use futures::join; use futures::join;
use log::info; use log::info;
use rauth; use rauth;
use rocket_cors::AllowedOrigins; use rocket_cors::AllowedOrigins;
fn main() { #[async_std::main]
task::block_on(entry()) async fn main() {
}
async fn entry() {
dotenv::dotenv().ok(); dotenv::dotenv().ok();
env_logger::init_from_env(env_logger::Env::default().filter_or("RUST_LOG", "info")); env_logger::init_from_env(env_logger::Env::default().filter_or("RUST_LOG", "info"));
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment