From 9e4c4551a786830bf34d74c4ef111a8ed292fa9f Mon Sep 17 00:00:00 2001 From: Vika Date: Tue, 15 Feb 2022 02:44:33 +0300 Subject: WIP: convert to Tokio and Warp Warp allows requests to be applied as "filters", allowing to flexibly split up logic and have it work in a functional style, similar to pipes. Tokio is just an alternative runtime. I thought that maybe switching runtimes and refactoring the code might allow me to fish out that pesky bug with the whole application hanging after a certain amount of requests... --- Cargo.toml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index 44115df..8b43c63 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Vika "] edition = "2021" [features] -default = ["util"] +default = [] util = ["anyhow"] [[bin]] @@ -26,7 +26,6 @@ required-features = ["util", "redis"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dev-dependencies] -tide-testing = "^0.1.3" # tide testing helper mockito = "^0.30.0" # HTTP mocking for Rust. tempdir = "^0.3.7" # A library for managing a temporary directory and deleting all contents when it's dropped paste = "^1.0.5" # Macros for all your token pasting needs @@ -51,32 +50,34 @@ rand = "^0.8.4" # Random number generators. retainer = "^0.2.2" # Minimal async cache in Rust with support for key expirations serde_json = "^1.0.64" # A JSON serialization file format serde_urlencoded = "^0.7.0" # `x-www-form-urlencoded` meets Serde -tide = "^0.16.0" # A minimal and pragmatic Rust web application framework built for rapid development relative-path = "^1.5.0" # Portable relative paths for Rust sha2 = "^0.9.8" # SHA-2 series of algorithms for Rust +[dependencies.tokio] +version = "^1.16.1" +features = ["full"] # TODO determine if my app doesn't need some features [dependencies.anyhow] version = "^1.0.42" optional = true -[dependencies.async-std] # Async version of the Rust standard library -version = "^1.9.0" -features = ["attributes", "unstable"] [dependencies.chrono] # Date and time library for Rust version = "^0.4.19" features = ["serde"] [dependencies.redis] version = "^0.21.3" optional = true -features = ["aio", "async-std-comp"] +features = ["aio", "tokio-comp"] [dependencies.prometheus] # Prometheus instrumentation library for Rust applications version = "^0.12.0" features = ["process"] [dependencies.serde] # A generic serialization/deserialization framework version = "^1.0.125" features = ["derive"] -[dependencies.surf] # Surf the web - HTTP client framework -version = "^2.2.0" -default-features = false -features = ["h1-client-rustls", "encoding", "middleware-logger"] [dependencies.url] # URL library for Rust, based on the WHATWG URL Standard version = "^2.2.1" features = ["serde"] +[dependencies.warp] +version = "^0.3.2" +default-features = false +features = ["multipart", "compression"] +[dependencies.hyper] +version = "^0.14.17" +features = ["client", "stream", "runtime"] \ No newline at end of file -- cgit 1.4.1