{"id":33931610,"url":"https://github.com/andrewlowndes/multi_stream","last_synced_at":"2026-05-28T01:31:09.736Z","repository":{"id":177372868,"uuid":"660313864","full_name":"andrewlowndes/multi_stream","owner":"andrewlowndes","description":"Aggregate multiple streams of different types in a single stream with an item type that is a tuple of the incoming stream items.","archived":false,"fork":false,"pushed_at":"2023-06-29T18:22:31.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-13T23:27:21.712Z","etag":null,"topics":["event-driven-programming","stream-processing"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrewlowndes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-06-29T18:19:22.000Z","updated_at":"2023-07-16T13:26:32.000Z","dependencies_parsed_at":"2025-12-12T16:10:15.055Z","dependency_job_id":null,"html_url":"https://github.com/andrewlowndes/multi_stream","commit_stats":null,"previous_names":["andrewlowndes/multi_stream"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andrewlowndes/multi_stream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewlowndes%2Fmulti_stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewlowndes%2Fmulti_stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewlowndes%2Fmulti_stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewlowndes%2Fmulti_stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewlowndes","download_url":"https://codeload.github.com/andrewlowndes/multi_stream/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewlowndes%2Fmulti_stream/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33590884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["event-driven-programming","stream-processing"],"created_at":"2025-12-12T12:53:48.226Z","updated_at":"2026-05-28T01:31:09.730Z","avatar_url":"https://github.com/andrewlowndes.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multi stream\nAggregate multiple streams of different types in a single stream with an item type that is a tuple of the incoming stream items.\n\n## Important\n- The streams are polled and a new stream item is emitted if any if ANY of the streams emits a new value\n- The values are cloned when the new stream value is emitted so incoming stream items must be clonable\n- Items in the tuple being emitted are all returned in `Option` as their corresponding stream may never emit\n- The macro supports up to 12 input streams only\n\n## Example usage\n- Add to your Cargo.toml file\n```toml\n[dependencies]\nmulti_stream = \"0.1.0\"\n```\n- Import the `muti_stream` macro and pass in stream instances to create a new stream:\n```rust\nuse async_stream::stream;\nuse futures::StreamExt;\nuse multi_stream::multi_stream;\nuse rand::random;\nuse std::time::Duration;\nuse tokio::time::sleep;\n\n#[tokio::main]\nasync fn main() {\n    let a = stream! {\n        sleep(Duration::from_millis(random::\u003cu8\u003e().into())).await;\n        yield 1;\n        sleep(Duration::from_millis(random::\u003cu8\u003e().into())).await;\n        yield 2;\n        sleep(Duration::from_millis(random::\u003cu8\u003e().into())).await;\n        yield 3;\n    };\n    let b = stream! {\n        sleep(Duration::from_millis(random::\u003cu8\u003e().into())).await;\n        yield 4;\n        sleep(Duration::from_millis(random::\u003cu8\u003e().into())).await;\n        yield 5;\n        sleep(Duration::from_millis(random::\u003cu8\u003e().into())).await;\n        yield 6;\n    };\n\n    multi_stream!(a, b)\n        .for_each(|(a, b)| async move {\n            //emitted when any of the streams has a new value\n            dbg!((a, b));\n        })\n        .await;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewlowndes%2Fmulti_stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewlowndes%2Fmulti_stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewlowndes%2Fmulti_stream/lists"}