{"id":27858436,"url":"https://github.com/roboplc/rflow","last_synced_at":"2025-05-04T14:10:30.738Z","repository":{"id":246571661,"uuid":"821514567","full_name":"roboplc/rflow","owner":"roboplc","description":"Chat-like HMI for embedded Rust applications and PLCs","archived":false,"fork":false,"pushed_at":"2025-01-18T02:05:42.000Z","size":137,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-30T08:09:42.467Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.bohemia-automation.com/software/libraries/","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/roboplc.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}},"created_at":"2024-06-28T18:03:29.000Z","updated_at":"2025-01-18T02:05:44.000Z","dependencies_parsed_at":"2024-06-28T19:27:18.000Z","dependency_job_id":"3a77ae7f-286b-4912-b2c2-00c68173e7c2","html_url":"https://github.com/roboplc/rflow","commit_stats":null,"previous_names":["roboplc/rflow"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboplc%2Frflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboplc%2Frflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboplc%2Frflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roboplc%2Frflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roboplc","download_url":"https://codeload.github.com/roboplc/rflow/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252344577,"owners_count":21732981,"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":"2025-05-04T14:10:30.111Z","updated_at":"2025-05-04T14:10:30.733Z","avatar_url":"https://github.com/roboplc.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch2\u003e\n  RFlow\n  \u003ca href=\"https://crates.io/crates/rflow\"\u003e\u003cimg alt=\"crates.io page\" src=\"https://img.shields.io/crates/v/rflow.svg\"\u003e\u003c/img\u003e\u003c/a\u003e\n  \u003ca href=\"https://docs.rs/rflow\"\u003e\u003cimg alt=\"docs.rs page\" src=\"https://docs.rs/rflow/badge.svg\"\u003e\u003c/img\u003e\u003c/a\u003e\n\u003c/h2\u003e\n\nChat-like HMI for embedded Rust applications and PLCs\n\nRFlow is a part of [RoboPLC](https://www.roboplc.com) project.\n\n## The idea\n\nMany of embedded applications and PLC programs do not have any human-machine\ninterface and not supposed to have one by design.\n\nHowever, sometimes it is very useful to have a simple way to interact with the\napplication, e.g. for debugging purposes or having a basic emergency interface\nin production.\n\nRFlow provides the most possible lightweight way to have a chat-like interface\nbetween the application (server) and its clients, which does not affect the\napplication real-time run-flow and consumes minimal system resources.\n\nThe [RFlow protocol](https://github.com/roboplc/rflow/blob/main/protocol.md) is\nfully text-based and can be used with no special client.\n\nMSRV: 1.81.0\n\n## Clients\n\n* [RFlow Chat](https://crates.io/crates/rflow-chat) - a dedicated RFlow chat\n  client (terminal).\n\n* Custom clients, built with the crate `Client` API.\n\n* Any terminal TCP client, e.g. `telnet`, `nc`.\n\n## A very basic example\n\n```rust,no_run\nuse std::{thread, time::Duration};\n\nuse rtsc::time::interval;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let data_channel = rflow::take_data_channel()?;\n    thread::spawn(move || {\n        rflow::serve(\"127.0.0.1:4001\").expect(\"failed to start server\");\n    });\n    thread::spawn(move || {\n        for _ in interval(Duration::from_secs(5)) {\n            rflow::send(\"ping\".to_string());\n        }\n    });\n    for data in data_channel {\n        println!(\"Received data: {}\", data);\n        rflow::send(format!(\"command accepted: {}\", data));\n        let command = data.trim();\n        if command == \"quit\" {\n            break;\n        }\n    }\n    Ok(())\n}\n```\n\n## Locking safety\n\nNote: the asynchronous client uses `parking_lot_rt` locking only.\n\nBy default, the crate (both the server and the client modules) uses\n[parking_lot](https://crates.io/crates/parking_lot) for locking. For real-time\napplications, the following features are available:\n\n* `locking-rt` - use [parking_lot_rt](https://crates.io/crates/parking_lot_rt)\n  crate which is a spin-free fork of parking_lot.\n\n* `locking-rt-safe` - use [rtsc](https://crates.io/crates/rtsc)\n  priority-inheritance locking, which is not affected by priority inversion\n  (Linux only).\n\nNote: to switch locking policy, disable the crate default features.\n\n## About\n\nRFlow is a part of [RoboPLC](https://www.roboplc.com/) project.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froboplc%2Frflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froboplc%2Frflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froboplc%2Frflow/lists"}