{"id":20608763,"url":"https://github.com/andeya/logimesh","last_synced_at":"2025-08-26T01:15:33.838Z","repository":{"id":251053958,"uuid":"836261027","full_name":"andeya/logimesh","owner":"andeya","description":"A Rust RPC microservice 2.0 framework inspired by  Towards Modern Development of Cloud Applications paper.","archived":false,"fork":false,"pushed_at":"2024-09-08T08:39:49.000Z","size":972,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-23T00:04:19.876Z","etag":null,"topics":["microservice","rpc"],"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/andeya.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}},"created_at":"2024-07-31T13:28:40.000Z","updated_at":"2024-12-11T15:08:56.000Z","dependencies_parsed_at":"2024-08-15T04:42:28.942Z","dependency_job_id":"76de1628-c61c-4eec-923f-800b80b776bc","html_url":"https://github.com/andeya/logimesh","commit_stats":null,"previous_names":["andeya/logimesh"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andeya/logimesh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andeya%2Flogimesh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andeya%2Flogimesh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andeya%2Flogimesh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andeya%2Flogimesh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andeya","download_url":"https://codeload.github.com/andeya/logimesh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andeya%2Flogimesh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272155802,"owners_count":24883104,"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","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"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":["microservice","rpc"],"created_at":"2024-11-16T10:11:48.325Z","updated_at":"2025-08-26T01:15:33.819Z","avatar_url":"https://github.com/andeya.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# logimesh\n\n`logimesh` is a Rust RPC Microservice 2.0 framework inspired by the [_Towards Modern Development of Cloud Applications_](https://dl.acm.org/doi/pdf/10.1145/3593856.3595909 \"target=_blank\") paper.\n\n_（This is one of my amateur idea and is only developed in leisure-time.）_\n\n[![Crates.io](https://img.shields.io/crates/v/logimesh)](https://crates.io/crates/logimesh)\n[![Documentation](https://shields.io/docsrs/logimesh)](https://docs.rs/logimesh)\n[![License](https://img.shields.io/crates/l/logimesh)](https://github.com/andeya/logimesh?tab=MIT-1-ov-file)\n\n![component](https://raw.githubusercontent.com/andeya/logimesh/main/docs/component.png)\n\n## Some features of logimesh:\n\n-   The client supports both local calls and remote calls simultaneously, meaning that users can dynamically switch the calling method according to the context.\n\n## Usage\n\nAdd to your `Cargo.toml` dependencies:\n\n```toml\nlogimesh = \"0.1\"\n```\n\nThe `logimesh::component` attribute expands to a collection of items that form an component component.\nThese generated types make it easy and ergonomic to write servers with less boilerplate.\nSimply implement the generated component trait, and you're off to the races!\n\n## Example\n\nThis example uses [tokio](https://tokio.rs), so add the following dependencies to\nyour `Cargo.toml`:\n\n```toml\n[lib]\nname = \"service\"\npath = \"src/lib.rs\"\n\n...\n\n[dependencies]\nlogimesh = { version = \"0.1\" }\nanyhow = \"1.0\"\ntokio = { version = \"1.0\", features = [\"macros\"] }\n```\n\nFor a more real-world example, see [logimesh-example](logimesh-example).\n\nFirst, let's set up the dependencies and component definition.\n\n### `lib.rs` file\n\n```rust\nextern crate logimesh;\n\n// This is the component definition. It looks a lot like a trait definition.\n// It defines one RPC, hello, which takes one arg, name, and returns a String.\n#[logimesh::component]\ntrait World {\n    /// Returns a greeting for name.\n    async fn hello(name: String) -\u003e String;\n}\n```\n\nThis component definition generates a trait called `World`. Next we need to\nimplement it for our Server struct.\n\n```rust\n# extern crate logimesh;\n#\n# // This is the component definition. It looks a lot like a trait definition.\n# // It defines one RPC, hello, which takes one arg, name, and returns a String.\n# #[logimesh::component]\n# trait World {\n#     /// Returns a greeting for name.\n#     async fn hello(name: String) -\u003e String;\n# }\n\nuse logimesh::context;\nuse logimesh::transport::codec::Codec;\n\n/// This is the type that implements the generated World trait. It is the business logic\n/// and is used to start the server.\n#[derive(Clone)]\npub struct CompHello;\n\nimpl World for CompHello {\n    const TRANSPORT_CODEC: Codec = Codec::Json;\n    async fn hello(self, ctx: context::Context, name: String) -\u003e String {\n        format!(\"Hello, {name}! context: {:?}\", ctx)\n    }\n}\n```\n\n### `server.rs` file\n\n```rust\nextern crate logimesh;\nextern crate tokio;\nextern crate anyhow;\n\n#[tokio::main]\nasync fn main() -\u003e anyhow::Result\u003c()\u003e {\n    logimesh::tokio_tcp_listen!(CompHello, logimesh::server::TcpConfig::new(\"[::1]:8888\".parse::\u003cstd::net::SocketAddrV6\u003e().unwrap()));\n    Ok(())\n}\n```\n\n### `client.rs` file\n\n```rust\nextern crate logimesh;\nextern crate tokio;\nextern crate anyhow;\n\nuse logimesh::client::balance::RandomBalance;\nuse logimesh::client::discover::FixedDiscover;\nuse logimesh::client::lrcall::ConfigExt;\nuse logimesh::component::Endpoint;\nuse logimesh::context;\nuse service::{CompHello, World};\n\n#[tokio::main]\nasync fn main() -\u003e anyhow::Result\u003c()\u003e {\n    let client = CompHello\n        .logimesh_lrclient(\n            Endpoint::new(\"p.s.m\"),\n            FixedDiscover::from_address(vec![\"[::1]:8888\".parse::\u003cstd::net::SocketAddrV6\u003e().unwrap()]),\n            RandomBalance::new(),\n            ConfigExt::default(),\n        )\n        .await?;\n\n    // Send the request twice, just to be safe! ;)\n    let hello = tokio::select! {\n        hello1 = client.hello(context::current(), format!(\"{}1\", flags.name)) =\u003e { hello1 }\n        hello2 = client.hello(context::current(), format!(\"{}2\", flags.name)) =\u003e { hello2 }\n    };\n\n    match hello {\n        Ok(hello) =\u003e println!(\"{hello:?}\"),\n        Err(e) =\u003e println!(\"{:?}\", anyhow::Error::from(e)),\n    }\n\n    Ok(())\n}\n```\n\n## Paper\n\nHere [Towards Modern Development of Cloud Applications](https://dl.acm.org/doi/pdf/10.1145/3593856.3595909 \"target=_blank\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandeya%2Flogimesh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandeya%2Flogimesh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandeya%2Flogimesh/lists"}