{"id":18763208,"url":"https://github.com/freenet/replay-channel","last_synced_at":"2025-04-13T04:32:31.917Z","repository":{"id":228071408,"uuid":"773116957","full_name":"freenet/replay-channel","owner":"freenet","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-21T01:49:10.000Z","size":66,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-26T21:38:27.863Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/freenet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2024-03-16T19:47:09.000Z","updated_at":"2024-10-15T06:25:51.000Z","dependencies_parsed_at":"2024-03-17T00:17:15.191Z","dependency_job_id":"8e5b097d-de39-43a9-9f17-061e10c8dc55","html_url":"https://github.com/freenet/replay-channel","commit_stats":null,"previous_names":["freenet/replay-channel"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freenet%2Freplay-channel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freenet%2Freplay-channel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freenet%2Freplay-channel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freenet%2Freplay-channel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/freenet","download_url":"https://codeload.github.com/freenet/replay-channel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247993830,"owners_count":21030045,"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":"2024-11-07T18:25:08.908Z","updated_at":"2025-04-13T04:32:31.652Z","avatar_url":"https://github.com/freenet.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ReplayChannel\n\n`ReplayChannel` is a Rust library that lets you create a channel where messages are broadcast to all \nreceivers. Importantly, if a new receiver is added later, they'll get all previously sent messages \nuntil they are caught up with the sender.\n\nDeveloped by [Ian Clarke](https://twitter.com/sanity) for the [Freenet Project](https://freenet.org/).\n\n## Features\n\n- **Message Replay:** New receivers are sent all previously sent messages until they are caught up with the sender.\n- **Multi-Receiver:** Supports multiple receivers, each with its own view of the message history and real-time stream.\n- **Asynchronous:** Designed to be used with Tokio, async-std, or any other async runtime.\n- **Efficient:** Uses an [AppendOnlyVec](https://crates.io/crates/append-only-vec) to store sent\n                   messages, avoiding locks.\n\n## Memory Usage\n\n`ReplayChannel` stores all sent messages, so the memory usage is proportional to the number of \nmessages sent. Because of this the number of messages sent should be bounded.\n\n## Getting Started\n\nTo use `ReplayChannel`, add it to your project's `Cargo.toml`:\n\n```bash\n$ cargo add replay-channel\n```\n\n### Usage Example\n\n```rust\nlet replay_channel = ReplayChannel::new();\nlet sender = replay_channel.sender();\nsender.send(\"message 1\");\nsender.send(\"message 2\");\n\nlet mut receiver = replay_channel.receiver();\nassert_eq!(receiver.receive().await, \"message 1\");\nassert_eq!(receiver.receive().await, \"message 2\");\n\nlet mut new_receiver = replay_channel.receiver();\nassert_eq!(new_receiver.receive().await, \"message 1\");\nassert_eq!(new_receiver.receive().await, \"message 2\");\n\nsender.send(\"message 3\");\nassert_eq!(new_receiver.receive().await, \"message 3\");\n```\n\n## License\n\nAvailable under the [MIT license](LICENSE.md).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreenet%2Freplay-channel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreenet%2Freplay-channel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreenet%2Freplay-channel/lists"}