hyperlane-core 22.8.0

A lightweight, high-performance, and cross-platform Rust HTTP server library built on Tokio. It simplifies modern web service development by providing built-in support for middleware, WebSocket, Server-Sent Events (SSE), and raw TCP communication. With a unified and ergonomic API across Windows, Linux, and MacOS, it enables developers to build robust, scalable, and event-driven network applications with minimal overhead and maximum flexibility.
Documentation
use super::*;

impl Drop for UringDropProbe {
    fn drop(&mut self) {
        let Self { state } = self;
        let available: bool =
            URING_REACTOR.with(|cell: &RefCell<Option<UringReactor>>| cell.try_borrow().is_ok());
        state
            .borrow_available
            .store(available, AtomicOrdering::Release);
        state.dropped.store(true, AtomicOrdering::Release);
    }
}

impl ServerHook for UringPendingDropRoute {
    async fn new(_: &mut Stream, _: &mut Context) -> Self {
        let state: Arc<UringDropState> =
            Arc::clone(URING_DROP_STATE.get_or_init(|| Arc::new(UringDropState::default())));
        Self {
            probe: UringDropProbe { state },
        }
    }

    async fn handle(self, _: &mut Stream, _: &mut Context) -> Status {
        let Self { probe } = self;
        let UringDropProbe { state } = &probe;
        let entered: bool =
            URING_REACTOR.with(|cell: &RefCell<Option<UringReactor>>| cell.borrow().is_some());
        state.entered_uring.store(entered, AtomicOrdering::Release);
        state.started.notify_one();
        pending::<()>().await;
        drop(probe);
        Status::Reject
    }
}