wsio-core 0.11.0

Shared core library for ws.io — provides common types, traits, and abstractions for WebSocket-based communication.
Documentation
1
2
3
4
5
6
7
8
9
10
use tokio::{
    sync::Mutex,
    task::JoinHandle,
};

pub async fn abort_locked_task(task: &Mutex<Option<JoinHandle<()>>>) {
    if let Some(task) = task.lock().await.take() {
        task.abort();
    }
}