|
@@ -1,17 +1,14 @@
|
|
|
use std::collections::BTreeMap;
|
|
use std::collections::BTreeMap;
|
|
|
use std::sync::Arc;
|
|
use std::sync::Arc;
|
|
|
use std::sync::atomic::AtomicBool;
|
|
use std::sync::atomic::AtomicBool;
|
|
|
-use std::time::Duration;
|
|
|
|
|
|
|
|
|
|
use futures_util::StreamExt;
|
|
use futures_util::StreamExt;
|
|
|
use tokio::sync::Mutex;
|
|
use tokio::sync::Mutex;
|
|
|
-use tokio_tungstenite::tungstenite::Message;
|
|
|
|
|
use tracing::{info, trace};
|
|
use tracing::{info, trace};
|
|
|
|
|
|
|
|
use exchanges::binance_swap_rest::BinanceSwapRest;
|
|
use exchanges::binance_swap_rest::BinanceSwapRest;
|
|
|
use exchanges::binance_swap_ws::{BinanceSwapLogin, BinanceSwapSubscribeType, BinanceSwapWs, BinanceSwapWsType};
|
|
use exchanges::binance_swap_ws::{BinanceSwapLogin, BinanceSwapSubscribeType, BinanceSwapWs, BinanceSwapWsType};
|
|
|
use exchanges::response_base::ResponseData;
|
|
use exchanges::response_base::ResponseData;
|
|
|
-use exchanges::socket_tool::AbstractWsMode;
|
|
|
|
|
use global::trace_stack::TraceStack;
|
|
use global::trace_stack::TraceStack;
|
|
|
|
|
|
|
|
const ACCESS_KEY: &str = "";
|
|
const ACCESS_KEY: &str = "";
|
|
@@ -25,7 +22,7 @@ async fn ws_custom_subscribe() {
|
|
|
|
|
|
|
|
|
|
|
|
|
let (write_tx, write_rx) = futures_channel::mpsc::unbounded();
|
|
let (write_tx, write_rx) = futures_channel::mpsc::unbounded();
|
|
|
- let (read_tx, mut read_rx) = futures_channel::mpsc::unbounded();
|
|
|
|
|
|
|
+ let (read_tx, mut read_rx) = futures_channel::mpsc::unbounded::<ResponseData>();
|
|
|
|
|
|
|
|
// let (write_tx, write_rx) = tokio::sync::broadcast::channel::<Message>(10);
|
|
// let (write_tx, write_rx) = tokio::sync::broadcast::channel::<Message>(10);
|
|
|
// let (read_tx, mut read_rx) = tokio::sync::broadcast::channel::<ResponseData>(10);
|
|
// let (read_tx, mut read_rx) = tokio::sync::broadcast::channel::<ResponseData>(10);
|