Skip to content

Commit

Permalink
chore: clean up imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Threated committed Sep 26, 2024
1 parent aae11f5 commit 6cc7ecf
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 18 deletions.
16 changes: 7 additions & 9 deletions broker/src/serve_sockets.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
use std::{borrow::Cow, collections::{HashMap, HashSet}, ops::Deref, sync::Arc, time::Duration};
use std::{sync::Arc, time::Duration};

use axum::{body::{Body, BodyDataStream}, extract::{Path, Request, State}, http::{header, request::Parts, StatusCode}, response::{IntoResponse, Response}, routing::get, RequestExt, Router};
use bytes::{Buf, BufMut, Bytes, BytesMut};
use axum::{body::{Body, BodyDataStream}, extract::{Path, State}, http::{header, request::Parts, StatusCode}, response::{IntoResponse, Response}, routing::get, Router};
use bytes::{BufMut, Bytes, BytesMut};
use dashmap::mapref::entry::Entry;
use futures_core::TryStream;
use futures_util::{stream, StreamExt};
use serde::{Serialize, Serializer, ser::SerializeSeq};
use shared::{config::{CONFIG_CENTRAL, CONFIG_SHARED}, crypto_jwt::Authorized, errors::SamplyBeamError, expire_map::LazyExpireMap, serde_helpers::DerefSerializer, Encrypted, HasWaitId, HowLongToBlock, Msg, MsgEmpty, MsgId, MsgSigned, MsgSocketRequest};
use tokio::{sync::{broadcast::{self, Sender}, oneshot, RwLock}, time::Instant};
use tracing::{debug, log::error, warn, Span};
use shared::{expire_map::LazyExpireMap, serde_helpers::DerefSerializer, Encrypted, HasWaitId, HowLongToBlock, Msg, MsgEmpty, MsgId, MsgSigned, MsgSocketRequest};
use tokio::{sync::oneshot, time::Instant};
use tracing::{debug, warn};

use crate::task_manager::{TaskManager, Task};
use crate::task_manager::TaskManager;


#[derive(Clone)]
Expand Down
1 change: 0 additions & 1 deletion proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ serde_json = "1"
rsa = "0.9"

# Server-sent Events (SSE) support
tokio-util = { version = "0.7", features = ["io"] }
futures = "0.3"
async-sse = "5.1"
async-stream = "0.3"
Expand Down
3 changes: 1 addition & 2 deletions proxy/src/serve_sockets.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::{
future::ready, io::{self, Write}, ops::{Deref, DerefMut}, pin::Pin, sync::Arc, task::Poll, time::{Duration, Instant, SystemTime}
future::ready, sync::Arc, task::Poll, time::{Duration, SystemTime}
};

use axum::{
Expand All @@ -17,7 +17,6 @@ use shared::{
config, ct_codecs::{self, Base64UrlSafeNoPadding, Decoder as B64Decoder, Encoder as B64Encoder}, expire_map::LazyExpireMap, http_client::SamplyHttpClient, reqwest, MessageType, MsgEmpty, MsgId, MsgSocketRequest, Plain
};
use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt, ReadBuf, ReadHalf, WriteHalf};
use tokio_util::codec::{Decoder, Encoder, Framed, FramedRead, FramedWrite};
use tracing::{warn, debug};

use crate::{
Expand Down
4 changes: 2 additions & 2 deletions shared/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ axum = { version = "0.7", features = [] }
bytes = "1.4"

# HTTP client with proxy support
reqwest = { version = "0.12", features = ["stream", "json"] }
reqwest = { version = "0.12", features = ["stream"] }

# Logging
tracing = "0.1"
Expand Down Expand Up @@ -55,7 +55,7 @@ beam-lib = { workspace = true }

[features]
expire_map = ["dep:dashmap"]
sockets = ["expire_map", "beam-lib/sockets"]
sockets = ["expire_map", "beam-lib/sockets", "reqwest/json"]
default = []
config-for-proxy = []
config-for-central = []
2 changes: 1 addition & 1 deletion tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"
publish = false
license = "Apache-2.0"

[dependencies]
[dev-dependencies]
tokio = { version = "1", features = ["macros", "io-util"] }
beam-lib = { workspace = true, features = ["http-util"] }
once_cell = "1"
Expand Down
5 changes: 2 additions & 3 deletions tests/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#![cfg(test)]

use once_cell::sync::Lazy;
use beam_lib::{AddressingId, set_broker_id, AppOrProxyId, BeamClient};

#[cfg(all(feature = "sockets", test))]
#[cfg(feature = "sockets")]
mod socket_test;

#[cfg(test)]
mod task_test;

#[cfg(test)]
mod test_sse;

pub static APP1: Lazy<AddressingId> = Lazy::new(|| {
Expand Down

0 comments on commit 6cc7ecf

Please sign in to comment.