{"id":15630726,"url":"https://github.com/sunli829/xactor","last_synced_at":"2025-04-04T13:08:37.565Z","repository":{"id":38275757,"uuid":"241290417","full_name":"sunli829/xactor","owner":"sunli829","description":"Xactor is a rust actors framework based on async-std","archived":false,"fork":false,"pushed_at":"2022-06-08T01:00:17.000Z","size":91,"stargazers_count":216,"open_issues_count":15,"forks_count":25,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-28T12:04:32.194Z","etag":null,"topics":["actor","actor-model","async","async-std","rust","rust-lang"],"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/sunli829.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}},"created_at":"2020-02-18T06:37:40.000Z","updated_at":"2025-02-22T08:58:38.000Z","dependencies_parsed_at":"2022-07-12T17:22:30.388Z","dependency_job_id":null,"html_url":"https://github.com/sunli829/xactor","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunli829%2Fxactor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunli829%2Fxactor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunli829%2Fxactor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sunli829%2Fxactor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sunli829","download_url":"https://codeload.github.com/sunli829/xactor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247178953,"owners_count":20896940,"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":["actor","actor-model","async","async-std","rust","rust-lang"],"created_at":"2024-10-03T10:35:53.825Z","updated_at":"2025-04-04T13:08:37.547Z","avatar_url":"https://github.com/sunli829.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Xactor is a rust actors framework based on async-std\n\n\u003cdiv align=\"center\"\u003e\n  \u003c!-- CI --\u003e\n  \u003cimg src=\"https://github.com/sunli829/potatonet/workflows/CI/badge.svg\" /\u003e\n  \u003c!-- Crates version --\u003e\n  \u003ca href=\"https://crates.io/crates/xactor\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/v/xactor.svg?style=flat-square\"\n    alt=\"Crates.io version\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- Downloads --\u003e\n  \u003ca href=\"https://crates.io/crates/xactor\"\u003e\n    \u003cimg src=\"https://img.shields.io/crates/d/xactor.svg?style=flat-square\"\n      alt=\"Download\" /\u003e\n  \u003c/a\u003e\n  \u003c!-- docs.rs docs --\u003e\n  \u003ca href=\"https://docs.rs/xactor\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square\"\n      alt=\"docs.rs docs\" /\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n## Documentation\n\n* [GitHub repository](https://github.com/sunli829/xactor)\n* [Cargo package](https://crates.io/crates/xactor)\n* Minimum supported Rust version: 1.39 or later\n\n## Features\n\n* Async actors.\n* Actor communication in a local context.\n* Using Futures for asynchronous message handling.\n* Typed messages (No `Any` type). Generic messages are allowed.\n\n## Examples\n\n```rust\nuse xactor::*;\n\n#[message(result = \"String\")]\nstruct ToUppercase(String);\n\nstruct MyActor;\n\nimpl Actor for MyActor {}\n\n#[async_trait::async_trait]\nimpl Handler\u003cToUppercase\u003e for MyActor {\n    async fn handle(\u0026mut self, _ctx: \u0026mut Context\u003cSelf\u003e, msg: ToUppercase) -\u003e String {\n        msg.0.to_uppercase()\n    }\n}\n\n#[xactor::main]\nasync fn main() -\u003e Result\u003c()\u003e {\n    // Start actor and get its address\n    let mut addr = MyActor.start().await?;\n\n    // Send message `ToUppercase` to actor via addr\n    let res = addr.call(ToUppercase(\"lowercase\".to_string())).await?;\n    assert_eq!(res, \"LOWERCASE\");\n    Ok(())\n}\n```\n\n## Performance\n\nhttps://github.com/sunli829/xactor-benchmarks\n\n## Installation\n\nXactor requires [async-trait](https://github.com/dtolnay/async-trait) on userland.\n\nWith [cargo add][cargo-add] installed, run:\n\n```sh\n$ cargo add xactor\n$ cargo add async-trait\n```\n\nWe also provide the [tokio](https://tokio.rs/) runtime instead of [async-std](https://async.rs/). To use it, you need to activate `runtime-tokio` and disable default features.\n\nYou can edit your `Cargo.toml` as follows:\n```toml\nxactor = { version = \"x.x.x\", features = [\"runtime-tokio\"], default-features = false }\n```\n\n[cargo-add]: https://github.com/killercup/cargo-edit\n\n## References\n\n* [Actix](https://github.com/actix/actix)\n* [Async-std](https://github.com/async-rs/async-std)\n* [Tokio](https://github.com/tokio-rs/tokio)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunli829%2Fxactor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsunli829%2Fxactor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsunli829%2Fxactor/lists"}