http-longpoll 0.1.0-rc.2

Idiomatic stream + sink interface for http longpoll
Documentation

HTTP Longpoll

HTTP Long Polling implementation with a simple idiomatic stream/sink API, making long polling as convenient as working with WebSockets.

Features

  • Async Stream + Sink API
  • Message batching and idle poll request timeouts
  • Transparent integration with popular web frameworks

Basic Example

use http_longpoll::{Session, Config};

let (handle, session) = Session::connect(Config::Default());

// simple echo
tokio::spawn(async move {
    let (mut tx, rx) = session.split();
    while let Some(message) = rx.next().await {
        println!("Received: {:?}", message);
        tx.send(message).await;
    }
});

Status

This project is under active development. While the core functionality is implemented, API changes may occur.