init move to http_server

This commit is contained in:
bitful-pannul 2023-10-19 01:51:00 +02:00 committed by dr-frmr
parent 315bea9876
commit ab14386893
No known key found for this signature in database
3 changed files with 5 additions and 2 deletions

View File

@ -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"

View File

@ -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;

View File

@ -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>>>>>;