mirror of
https://github.com/uqbar-dao/nectar.git
synced 2024-12-22 08:01:47 +03:00
init move to http_server
This commit is contained in:
parent
315bea9876
commit
ab14386893
@ -48,6 +48,7 @@ rand = "0.8.4"
|
||||
reqwest = "0.11.18"
|
||||
ring = "0.16.20"
|
||||
rsa = "0.9"
|
||||
route-recognizer = "0.3.1"
|
||||
rusoto_core = "0.48.0"
|
||||
rusoto_s3 = "0.48.0"
|
||||
rusoto_credential = "0.48.0"
|
||||
@ -64,5 +65,4 @@ warp = "0.3.5"
|
||||
wasmtime = "12.0.1"
|
||||
wasmtime-wasi = "12.0.1"
|
||||
zip = "0.6"
|
||||
base64 = "0.13"
|
||||
route-recognizer = "0.3.1"
|
||||
base64 = "0.13"
|
@ -7,6 +7,7 @@ use base64;
|
||||
use futures::SinkExt;
|
||||
use futures::StreamExt;
|
||||
use serde_urlencoded;
|
||||
use base64;
|
||||
|
||||
use route_recognizer::Router;
|
||||
use std::collections::HashMap;
|
||||
@ -905,6 +906,7 @@ async fn handler(
|
||||
.await
|
||||
.insert(id, (original_path.clone(), response_sender));
|
||||
|
||||
let message = km.unwrap(); // DOUBLECHECK
|
||||
send_to_loop.send(message).await.unwrap();
|
||||
let timeout_duration = tokio::time::Duration::from_secs(15); // adjust as needed
|
||||
let result = tokio::time::timeout(timeout_duration, response_receiver).await;
|
||||
|
@ -10,6 +10,7 @@ use tokio::net::TcpListener;
|
||||
use tokio::sync::Mutex;
|
||||
use warp::http::{header::HeaderName, header::HeaderValue, HeaderMap};
|
||||
use warp::ws::WebSocket;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
pub type SharedWriteStream = Arc<Mutex<SplitSink<WebSocket, warp::ws::Message>>>;
|
||||
pub type WebSockets = Arc<Mutex<HashMap<String, HashMap<String, HashMap<u64, SharedWriteStream>>>>>;
|
||||
|
Loading…
Reference in New Issue
Block a user