changed the oneshot of tokio to mpsc of std
This commit is contained in:
parent
125f23792f
commit
6a5aba6ae5
@ -10,7 +10,7 @@ use tokio::sync::oneshot;
|
|||||||
async fn main() {
|
async fn main() {
|
||||||
let _guard = log::init_log();
|
let _guard = log::init_log();
|
||||||
|
|
||||||
let (tx, rx) = oneshot::channel();
|
let (tx, rx) = std::sync::mpsc::channel();
|
||||||
let _ = run_sdlan(
|
let _ = run_sdlan(
|
||||||
CommandLine {
|
CommandLine {
|
||||||
sn: "39.98.184.67:1265".to_owned(),
|
sn: "39.98.184.67:1265".to_owned(),
|
||||||
@ -27,7 +27,7 @@ async fn main() {
|
|||||||
}, tx,
|
}, tx,
|
||||||
).await;
|
).await;
|
||||||
|
|
||||||
rx.await;
|
rx.recv();
|
||||||
|
|
||||||
let edge = get_edge();
|
let edge = get_edge();
|
||||||
edge.start("0".to_owned()).await;
|
edge.start("0".to_owned()).await;
|
||||||
|
|||||||
@ -22,7 +22,7 @@ use sdlan_sn_rs::{
|
|||||||
|
|
||||||
pub async fn run_sdlan(
|
pub async fn run_sdlan(
|
||||||
args: CommandLine,
|
args: CommandLine,
|
||||||
sender: tokio::sync::oneshot::Sender<bool>,
|
sender: std::sync::mpsc::Sender<bool>,
|
||||||
// start_stop_sender: Sender<String>,
|
// start_stop_sender: Sender<String>,
|
||||||
// start_stop_receiver: Receiver<String>,
|
// start_stop_receiver: Receiver<String>,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user