{"id":28200820,"url":"https://github.com/esrlabs/flux-mcf","last_synced_at":"2026-01-26T04:02:21.145Z","repository":{"id":249286116,"uuid":"830994326","full_name":"esrlabs/flux-mcf","owner":"esrlabs","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-02T15:57:42.000Z","size":589,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-12T17:46:24.874Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/esrlabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","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-19T12:20:18.000Z","updated_at":"2025-03-15T15:14:03.000Z","dependencies_parsed_at":"2025-06-12T17:37:39.455Z","dependency_job_id":"f190acab-7e63-43de-b2ae-5c51b9661438","html_url":"https://github.com/esrlabs/flux-mcf","commit_stats":null,"previous_names":["esrlabs/flux-mcf"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/esrlabs/flux-mcf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esrlabs%2Fflux-mcf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esrlabs%2Fflux-mcf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esrlabs%2Fflux-mcf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esrlabs%2Fflux-mcf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/esrlabs","download_url":"https://codeload.github.com/esrlabs/flux-mcf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esrlabs%2Fflux-mcf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28766364,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T03:54:34.369Z","status":"ssl_error","status_checked_at":"2026-01-26T03:54:33.031Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2025-05-16T21:17:31.025Z","updated_at":"2026-01-26T04:02:21.139Z","avatar_url":"https://github.com/esrlabs.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"MCF - a minimalistic distributed processing framework\n=====================================================\n\n#### Generating Documentation (Optional)\nWe use sphinx to generate our code documentation. To generate the documentation:\n1) Install python dependencies: `pip install -r docs/requirements.txt`\n2) Generate documentation: `bash generate_docs.sh build`\n3) Open documentation: `gnome-open docs/sphinx/index.html`\n4) Clean documentation: `bash generate_docs.sh clean`\n## Overview\n\nMCF (Messages and Components Framework) is a minimalistic framework to harness\nmulti-node computations, similar to ROS, Apollo.auto's CyberRT, AUTOSAR\nAdaptive and others. The development has been specifically focused on\nsimplicity, minimal abstraction, and the ability to use in near-embedded and\nembedded environments.\n\n## Rationale\n\nTypical applications in automotive and robotics are best tackled with\nevent-driven, concurrent software architectures. Hence, MCF provides a way to\ncompose such architectures by defining basic blocks -- `Component`s, which\ncommunicate `Value`s over `Port`s. Each `Component` runs in a separate thread,\nwhich enables different data processing steps to run in parallel.\n\n### Features\n\n* Zero-copy in-process data sharing\n* Ability to isolate parts of computation in separate processes\n* Reconfiguration of processing graph without recompilation\n* Introspection and prototyping from Python\n* Real-time thread scheduling support\n* Builds and runs on x86_64 and ARM aarch64 platforms\n\n### Why MCF?\n\nIn contrast to ROS and CyberRT, we have built MCF to be minimalistic.\nNon-goals are automated service discovery, QoS layers, custom/proprietary\nbuild systems and environments, experimental and configurable multi-tasking\nmechanisms etc.\nInstead, our focus lies in a small, feature-complete, fully controllable\ncodebase.\n\n## Usage\n\nMCF is meant to be used as a library. To build the library, the following\ndependencies (in addition to those of your particular project) are required.\n\n* (core) C++14 compiler (GCC ≥ 7)\n* (core) spdlog\n* (core) gtest\n* (core) zeromq\n* (core) msgpack-c\n* (core) jsoncpp\n* (remote) Boost.Interprocess\n* (remote) CLI11\n* (cuda) CUDA ≥ 10\n\nCompiling MCF is possible with [CMake](https://cmake.org/) and\n[Bake](http://esrlabs.github.io/bake/) build systems. So far only Linux targets\nhave been tested; ports to other platforms are welcome.\n\n### Using MCF in your own project\n\nMCF is meant to be used as a (statically or dynamically linked) library. CMake\nand Bake build files are provided. The library itself has three parts:\n`mcf_core`, `mcf_remote`, and `mcf_cuda`. The main functionality is provided by\n`mcf_core`, inter-process features reside in `mcf_remote`, CUDA-specific\nfeatures (such as wrappers around CUDA memory objects etc) can be found in\n`mcf_cuda`.\n\nBelow is a minimal setup on how to use MCF to process a single integer value\n```cpp\n#include \"mcf_core/Mcf.h\"\n#include \u003ciostream\u003e\n\nconst std::string inputTopicName = \"/number\";\nconst std::string outputTopicName = \"/bigger_number\";\n\n/*\nAny kind of message data has to be derived from `mcf::Value`. In this case, we\nwrap an integer data type into a Value.\n*/\nstruct Integer : public mcf::Value\n{\npublic:\n    explicit Integer(int64_t _value) : value(_value) {}\n    \n    int64_t value;\n    MSGPACK_DEFINE(value);\n};\n\n/*\nThe class below defines a Component. A `Component` is roughly defined as a set\nof `Port`s which are used to communicate `Value`s and port handlers, which\nprocess incoming messages.\n\nIn this example, the `Component` reads an integer value whenever it is written\nto the value store on the input topic, increments it, and writes the new value\nto another topic.\n*/\nclass MathComponent : public mcf::Component\n{\npublic:\n    // A constructor must initialize the `Component` sub-object with the name\n    // of this component; the ports need to be initialized with the component\n    // owning them and their name\n    MathComponent() \n    : mcf::Component(\"MathComponent\")\n    , _numberInputPort(*this, \"in_number\")\n    , _numberOutputPort(*this, \"out_number\")\n    {\n        // Assign a message handler for the input port\n        _numberInputPort.registerHandler([this] () { handleInput(); });\n    }\n    \n    // A `Component` must have a configure() method in which its `Port`s can\n    // be made known to the system and tied to message topics.\n    void configure(mcf::IComponentConfig\u0026 config) override\n    {\n        config.registerPort(_numberInputPort, inputTopicName);\n        config.registerPort(_numberOutputPort, outputTopicName);\n    }\n    \nprivate:\n    // The actual message handler\n    void handleInput()\n    {\n        // get a std::shared_ptr\u003cconst Integer\u003e to the current input\n        std::shared_ptr\u003cconst Integer\u003e input = _numberInputPort.getValue();\n        std::cout \u003c\u003c input-\u003evalue;\n        // write a value to the output port\n        _numberOutputPort.setValue(Integer(input-\u003evalue + 1));\n    }\n\n    mcf::ReceiverPort\u003cInteger\u003e _numberInputPort;\n    mcf::SenderPort\u003cInteger\u003e _numberOutputPort;\n};\n\nint main(int argc, char *argv)\n{\n    // Initialize parts of the middleware\n    // The `ValueStore` is the central message exchange object, similar to a\n    // database\n    mcf::ValueStore valueStore;\n    // The `ComponentManager` takes care of the `Component` lifecycle\n    mcf::ComponentManager manager(valueStore);\n    // The Component itself needs to be created...\n    auto component = std::make_shared\u003cMathComponent\u003e();\n    // ...and made known to the ComponentManager which will take care of it\n    // from now on\n    manager.registerComponent(component);\n    // `configure()` sets up the wiring between all known`Component` s\n    manager.configure();\n    // `startup()` starts the event loop of each registered `Component`\n    manager.startup();\n    \n    // In this minimalistic example we have only a single component and\n    // therefore we talk to it by directly sending and receiving via the \n    // ValueStore. In a more realistic example, there would be another\n    // component sending and receiving such values via ports.\n\n    // Write a value to the value store\n    valueStore.setValue(inputTopicName, Integer(41));\n    // wait until the component is ready\n    std::this_thread::sleep_for(std::chrono::milliseconds(100));\n    std::cout \u003c\u003c \"The answer is\" \u003c\u003c valueStore.getValue(outputTopicName)-\u003evalue \u003c\u003c std::endl;\n    \n    // `shutdown()` stops the event loops\n    manager.shutdown();\n    return EXIT_SUCCESS;\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesrlabs%2Fflux-mcf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesrlabs%2Fflux-mcf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesrlabs%2Fflux-mcf/lists"}