Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
Correct way to run the executor
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmarkov committed Oct 19, 2023
1 parent 7edc81d commit f712acd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,8 @@ fn test_mqtt_client() -> Result<EspMqttClient<'static, ConnState<MessageImpl, Es

#[cfg(not(esp_idf_version = "4.3"))]
fn test_tcp_bind_async() -> anyhow::Result<()> {
use std::pin::pin;

use async_executor::LocalExecutor;

async fn test_tcp_bind(executor: &LocalExecutor<'_>) -> std::io::Result<()> {
Expand Down Expand Up @@ -743,7 +745,9 @@ fn test_tcp_bind_async() -> anyhow::Result<()> {
thread::Builder::new().stack_size(20000).spawn(move || {
let executor = LocalExecutor::new();

async_io::block_on(test_tcp_bind(&executor)).unwrap();
let fut = &mut pin!(test_tcp_bind(&executor));

async_io::block_on(executor.run(fut)).unwrap();
})?;

Ok(())
Expand Down

0 comments on commit f712acd

Please sign in to comment.