{"id":15762367,"url":"https://github.com/williamvenner/threadbeam","last_synced_at":"2026-03-01T09:32:06.408Z","repository":{"id":62444627,"uuid":"500841554","full_name":"WilliamVenner/threadbeam","owner":"WilliamVenner","description":"A simple, specialized channel type for beaming data out of a newly spawned thread","archived":false,"fork":false,"pushed_at":"2022-08-13T11:34:34.000Z","size":12,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T03:04:02.168Z","etag":null,"topics":["channel","no-std","oneshot","rust","spsc","thread","threads"],"latest_commit_sha":null,"homepage":"https://docs.rs/threadbeam/latest","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WilliamVenner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-07T12:59:19.000Z","updated_at":"2023-07-18T21:54:51.000Z","dependencies_parsed_at":"2022-11-01T22:30:37.470Z","dependency_job_id":null,"html_url":"https://github.com/WilliamVenner/threadbeam","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fthreadbeam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fthreadbeam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fthreadbeam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fthreadbeam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WilliamVenner","download_url":"https://codeload.github.com/WilliamVenner/threadbeam/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249996098,"owners_count":21358063,"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":["channel","no-std","oneshot","rust","spsc","thread","threads"],"created_at":"2024-10-04T11:08:55.733Z","updated_at":"2026-03-01T09:32:06.333Z","avatar_url":"https://github.com/WilliamVenner.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![crates.io](https://img.shields.io/crates/v/threadbeam.svg)](https://crates.io/crates/threadbeam)\n[![docs.rs](https://docs.rs/threadbeam/badge.svg)](https://docs.rs/threadbeam/)\n[![license](https://img.shields.io/crates/l/threadbeam)](https://github.com/WilliamVenner/threadbeam/blob/master/LICENSE)\n\n# threadbeam\n\nA simple, specialized channel type for beaming data out of a newly spawned thread.\n\n# Usage\n\nFirst, add `threadbeam` to your crate's dependencies in Cargo.toml:\n\n```toml\n[dependencies]\nthreadbeam = \"0\"\n```\n\n## Examples\n\n```rust\nlet (tx, rx) = threadbeam::channel();\n\nstd::thread::spawn(move || {\n    tx.send(String::from(\"Hello, world!\"));\n});\n\nlet hello = rx.recv();\nassert_eq!(hello.as_deref(), Some(\"Hello, world!\"));\n```\n\n```rust\nlet (hello, thread) = threadbeam::spawn(move |tx| {\n    tx.send(String::from(\"Hello, world!\"));\n    // your code...\n    String::from(\"Thread completed!\")\n});\n\nassert_eq!(hello.as_deref(), Some(\"Hello, world!\"));\nassert_eq!(thread.join().ok().as_deref(), Some(\"Thread completed!\"));\n```\n\n## [`parking_lot`](https://docs.rs/parking_lot/latest)\n\nTo use [`parking_lot`](https://docs.rs/parking_lot/latest) instead of the standard library's implementations of `Condvar` and `Mutex`, enable the `parking_lot` feature in your Cargo.toml:\n\n```toml\n[dependencies]\nthreadbeam = { version = \"0\", features = [\"parking_lot\"] }\n```\n\n## `no_std` via [`spin`](https://docs.rs/spin/latest)\n\nFor `no_std` environments, enable the `no_std` feature in your Cargo.toml:\n\nThis will use [`spin`](https://docs.rs/spin/latest) as the provider of the `Mutex` implementation.\n\n```toml\n[dependencies]\nthreadbeam = { version = \"0\", features = [\"no_std\"] }\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamvenner%2Fthreadbeam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilliamvenner%2Fthreadbeam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamvenner%2Fthreadbeam/lists"}