{"id":26630340,"url":"https://github.com/thomaseizinger/sairun","last_synced_at":"2025-03-24T13:18:47.668Z","repository":{"id":283804691,"uuid":"952851978","full_name":"thomaseizinger/sairun","owner":"thomaseizinger","description":"An async runtime for sans-IO code.","archived":false,"fork":false,"pushed_at":"2025-03-22T09:31:56.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T10:19:15.519Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thomaseizinger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-22T02:26:07.000Z","updated_at":"2025-03-22T09:40:34.000Z","dependencies_parsed_at":"2025-03-22T10:19:17.877Z","dependency_job_id":"e57b8545-b752-45d7-b657-b79aad33dc08","html_url":"https://github.com/thomaseizinger/sairun","commit_stats":null,"previous_names":["thomaseizinger/rust-sans-io-runtime"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaseizinger%2Fsairun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaseizinger%2Fsairun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaseizinger%2Fsairun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thomaseizinger%2Fsairun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thomaseizinger","download_url":"https://codeload.github.com/thomaseizinger/sairun/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245276092,"owners_count":20588894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-24T13:18:46.661Z","updated_at":"2025-03-24T13:18:47.656Z","avatar_url":"https://github.com/thomaseizinger.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sairun - **sa**ns-**I**O async **run**time\n\nsairun is an experimental async runtime for sans-IO implementations.\nsans-IO is cool but it is annoying that we have to write our own state machines for handling what are essentially async operations.\nIt would be much better if we could just use async/await and let the compiler handle composing for us.\n\nWith sairun, you can now do this! (on nightly)\n\nEssentially, `sairun` is just a sans-IO component itself that acts as a bridge between its `Future`s and your actual IO code.\n\n```rust\nasync fn greet() {\n    let src = \"127.0.0.1:1234\".parse().unwrap();\n    let dst = \"192.168.0.1:5678\".parse().unwrap();\n\n    sairun::udp::send_to(src, dst, \"Hello\".as_bytes().to_vec()).await;\n\n    let msg = sairun::udp::recv_from(src, dst).await;\n    let msg = String::from_utf8(msg).unwrap();\n\n    println!(\"Received '{msg}' from {dst}\");\n}\n\n#[test]\nfn send_receive() {\n    let mut runtime = sairun::Runtime::default();\n\n    runtime.spawn(greet(), Instant::now());\n\n    loop {\n        if let Some(msg) = runtime.poll_datagram() {\n            // Use an actual socket to send the UDP datagram\n        }\n\n        let (local, remote, msg) = todo!(\"receive datagram from a socket\");\n\n        runtime.handle_input(local, remote, msg, Instant::now());\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomaseizinger%2Fsairun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthomaseizinger%2Fsairun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthomaseizinger%2Fsairun/lists"}