{"id":13423316,"url":"https://github.com/drogue-iot/ector","last_synced_at":"2025-04-05T00:05:10.041Z","repository":{"id":38351299,"uuid":"503270029","full_name":"drogue-iot/ector","owner":"drogue-iot","description":"Ector is an open source async, no-alloc actor framework for embedded devices.","archived":false,"fork":false,"pushed_at":"2025-02-25T09:52:52.000Z","size":95,"stargazers_count":54,"open_issues_count":0,"forks_count":10,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-28T23:03:24.058Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drogue-iot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2022-06-14T08:19:47.000Z","updated_at":"2025-03-18T05:58:01.000Z","dependencies_parsed_at":"2024-10-26T22:50:35.424Z","dependency_job_id":"fbc9d7ed-b13d-4ab3-ad94-34064dcf94fd","html_url":"https://github.com/drogue-iot/ector","commit_stats":{"total_commits":27,"total_committers":5,"mean_commits":5.4,"dds":0.4814814814814815,"last_synced_commit":"0edcbfeeb13b9aa2ef3873a4ec43188f9197b147"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drogue-iot%2Fector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drogue-iot%2Fector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drogue-iot%2Fector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drogue-iot%2Fector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drogue-iot","download_url":"https://codeload.github.com/drogue-iot/ector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266562,"owners_count":20910836,"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-07-31T00:00:30.447Z","updated_at":"2025-04-05T00:05:10.022Z","avatar_url":"https://github.com/drogue-iot.png","language":"Rust","readme":"# Ector is an open source async, no-alloc actor framework for embedded devices\n\n[![CI](https://github.com/drogue-iot/ector/actions/workflows/ci.yaml/badge.svg)](https://github.com/drogue-iot/ector/actions/workflows/ci.yaml)\n[![crates.io](https://img.shields.io/crates/v/ector.svg)](https://crates.io/crates/ector)\n[![docs.rs](https://docs.rs/ector/badge.svg)](https://docs.rs/ector)\n\nEctor is an open source async, no-alloc actor framework for embedded devices. It integrates with [embassy](https://github.com/embassy-rs/embassy), the embedded async project.\n\n## Actor System\n\nAn _actor system_ is a framework that allows for isolating state within narrow contexts, making it easier to reason about system.\nWithin a actor system, the primary component is an _Actor_, which represents the boundary of state usage.\nEach actor has exclusive access to its own state and only communicates with other actors through message-passing.\n\n## Example\n\n```rust ignore\nuse ector::*;\n\n/// A Counter that we wish to create an Actor for.\npub struct Counter {\n    count: u32,\n}\n\n// The message our actor will handle.\npub struct Increment;\n\n/// An Actor implements the Actor trait.\nimpl Actor for Counter {\n    /// The Message associated type is the message types that the Actor can receive.\n    type Message = Increment;\n\n    /// An actor has to implement the on_mount method. on_mount() is invoked when the internals of an actor is ready,\n    /// and the actor can begin to receive messages from an inbox.\n    ///\n    /// The following arguments are provided:\n    /// * The address to 'self'\n    /// * An inbox from which the actor can receive messages\n    async fn on_mount\u003cM\u003e(\u0026mut self, _: DynamicAddress\u003cSelf::Message\u003e, mut inbox: M) -\u003e !\n    where M: Inbox\u003cSelf::Message\u003e {\n        loop {\n            // Await the next message and increment the counter\n            let _ = inbox.next().await;\n            self.count += 1;\n        }\n    }\n}\n\n /// The entry point of the application is using the embassy runtime.\n #[embassy_executor::main]\n async fn main(spawner: embassy_executor::Spawner) {\n\n     // Mounting the Actor will spawn an embassy task\n     let addr = ector::actor!(spawner, counter, Counter, Counter { count: 0 });\n\n     // The actor address may be used in any embassy task to communicate with the actor.\n     let _ = addr.notify(Increment).await;\n }\n```\n\n## Building\n\nYou can build and test the framework by running\n\n```shell\ncargo test\n```\n\n## Directory layout\n\n* `ector` - an actor framework\n* `macros` - macros used by application code to simplify\n\n## Contributing\n\nSee the document [CONTRIBUTING.md](CONTRIBUTING.md).\n","funding_links":[],"categories":["no-std crates"],"sub_categories":["WIP"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrogue-iot%2Fector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrogue-iot%2Fector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrogue-iot%2Fector/lists"}