lox/crates/rdsys-backend
Cecylia Bocovich eb43414574 Only return Poll::Pending if the inner future returns it
The waker stored in the future will only wake up and re-poll the stream
if the call to future returned Poll::Pending. Because of this, if we
didn't receive enough data to reconstruct the ResourceDiff, we need to
loop and poll the inner future again rather than return Poll::Pending
ourselves.
2023-03-22 17:41:08 -04:00
..
src Only return Poll::Pending if the inner future returns it 2023-03-22 17:41:08 -04:00
.gitignore Initial commit 2023-01-20 16:01:03 -05:00
Cargo.toml Use a ReusableBoxFuture to store ReceiverStream 2023-03-22 15:05:05 -04:00
README.md Use rust listing in markdown 2023-01-30 15:25:41 -05:00

README.md

rdsys backend API

Usage

use rdsys_backend::start_stream;
use tokio;

#[tokio::main]
async fn main() {
    let endpoint = String::from("http://127.0.0.1:7100/resource-stream");
    let name = String::from("https");
    let token = String::from("HttpsApiTokenPlaceholder");
    let types = vec![String::from("obfs2"), String::from("scramblesuit")];
    let rx = start_stream(endpoint, name, token, types).await.unwrap();
    for diff in rx {
        println!("Received diff: {:?}", diff);
    }
}