{"id":29820818,"url":"https://github.com/reactive-extensions/rxcpp","last_synced_at":"2025-07-28T23:10:01.971Z","repository":{"id":38848166,"uuid":"12584062","full_name":"ReactiveX/RxCpp","owner":"ReactiveX","description":"Reactive Extensions for C++","archived":false,"fork":false,"pushed_at":"2024-07-30T22:41:39.000Z","size":63094,"stargazers_count":3135,"open_issues_count":100,"forks_count":404,"subscribers_count":162,"default_branch":"main","last_synced_at":"2025-07-25T12:46:51.021Z","etag":null,"topics":["algorithms","c-plus-plus","reactivex","rxcpp","values-distributed-in-time","virtuous-procrastination"],"latest_commit_sha":null,"homepage":"","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/ReactiveX.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.txt","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-09-04T06:56:36.000Z","updated_at":"2025-07-23T11:06:16.000Z","dependencies_parsed_at":"2024-01-29T17:17:05.807Z","dependency_job_id":"34bf83b4-314c-495f-a73a-c00da40774d1","html_url":"https://github.com/ReactiveX/RxCpp","commit_stats":{"total_commits":848,"total_committers":70,"mean_commits":"12.114285714285714","dds":"0.41273584905660377","last_synced_commit":"761b932a80e2be6e2b62d232e754bd96fc448946"},"previous_names":["reactive-extensions/rxcpp"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/ReactiveX/RxCpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReactiveX%2FRxCpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReactiveX%2FRxCpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReactiveX%2FRxCpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReactiveX%2FRxCpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ReactiveX","download_url":"https://codeload.github.com/ReactiveX/RxCpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReactiveX%2FRxCpp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267600502,"owners_count":24113794,"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-07-28T02:00:09.689Z","response_time":68,"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":["algorithms","c-plus-plus","reactivex","rxcpp","values-distributed-in-time","virtuous-procrastination"],"created_at":"2025-07-28T23:09:57.016Z","updated_at":"2025-07-28T23:10:01.965Z","avatar_url":"https://github.com/ReactiveX.png","language":"C++","readme":"The Reactive Extensions for C++ (__RxCpp__) is a library of algorithms for values-distributed-in-time. The [__Range-v3__](https://github.com/ericniebler/range-v3) library does the same for values-distributed-in-space.\n\nTask    | Status | \n----------- | :------------ |\nrxcpp CI | [![rxcpp CI](https://img.shields.io/github/workflow/status/ReactiveX/RxCpp/rxcpp%20CI/main.svg?event=push\u0026style=flat-square)](https://github.com/ReactiveX/RxCpp/actions/workflows/rxcpp-ci.yml)\n\nSource        | Badges |\n------------- | :--------------- |\nGithub | [![GitHub license](https://img.shields.io/github/license/ReactiveX/RxCpp.svg?style=flat-square)](https://github.com/ReactiveX/RxCpp) \u003cbr/\u003e [![GitHub release](https://img.shields.io/github/release/ReactiveX/RxCpp.svg?style=flat-square)](https://github.com/ReactiveX/RxCpp/releases) \u003cbr/\u003e [![GitHub commits](https://img.shields.io/github/commits-since/ReactiveX/RxCpp/4.1.0.svg?style=flat-square)](https://github.com/ReactiveX/RxCpp)\nGitter.im | [![Join in on gitter.im](https://img.shields.io/gitter/room/Reactive-Extensions/RxCpp.svg?style=flat-square)](https://gitter.im/ReactiveX/RxCpp?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\nPackages | [![NuGet version](http://img.shields.io/nuget/v/RxCpp.svg?style=flat-square)](http://www.nuget.org/packages/RxCpp/) [![vcpkg port](https://img.shields.io/badge/vcpkg-port-blue.svg?style=flat-square)](https://github.com/Microsoft/vcpkg/tree/master/ports/rxcpp)\nDocumentation | [![rxcpp doxygen documentation](https://img.shields.io/badge/rxcpp-latest-brightgreen.svg?style=flat-square)](http://reactivex.github.io/RxCpp) \u003cbr/\u003e [![reactivex intro](https://img.shields.io/badge/reactivex.io-intro-brightgreen.svg?style=flat-square)](http://reactivex.io/intro.html) [![rx marble diagrams](https://img.shields.io/badge/rxmarbles-diagrams-brightgreen.svg?style=flat-square)](http://rxmarbles.com/)\n\n# Usage\n\n__RxCpp__ is a header-only C++ library that only depends on the standard library. The CMake build generates documentation and unit tests. The unit tests depend on a git submodule for the [Catch](https://github.com/philsquared/Catch) library.\n\n# Example\nAdd `Rx/v2/src` to the include paths\n\n[![lines from bytes](https://img.shields.io/badge/blog%20post-lines%20from%20bytes-blue.svg?style=flat-square)](http://kirkshoop.github.io/async/rxcpp/c++/2015/07/07/rxcpp_-_parsing_bytes_to_lines_of_text.html)\n\n```cpp\n#include \"rxcpp/rx.hpp\"\nnamespace Rx {\nusing namespace rxcpp;\nusing namespace rxcpp::sources;\nusing namespace rxcpp::operators;\nusing namespace rxcpp::util;\n}\nusing namespace Rx;\n\n#include \u003cregex\u003e\n#include \u003crandom\u003e\nusing namespace std;\nusing namespace std::chrono;\n\nint main()\n{\n    random_device rd;   // non-deterministic generator\n    mt19937 gen(rd());\n    uniform_int_distribution\u003c\u003e dist(4, 18);\n\n    // for testing purposes, produce byte stream that from lines of text\n    auto bytes = range(0, 10) |\n        flat_map([\u0026](int i){\n            auto body = from((uint8_t)('A' + i)) |\n                repeat(dist(gen)) |\n                as_dynamic();\n            auto delim = from((uint8_t)'\\r');\n            return from(body, delim) | concat();\n        }) |\n        window(17) |\n        flat_map([](observable\u003cuint8_t\u003e w){\n            return w |\n                reduce(\n                    vector\u003cuint8_t\u003e(),\n                    [](vector\u003cuint8_t\u003e v, uint8_t b){\n                        v.push_back(b);\n                        return v;\n                    }) |\n                as_dynamic();\n        }) |\n        tap([](const vector\u003cuint8_t\u003e\u0026 v){\n            // print input packet of bytes\n            copy(v.begin(), v.end(), ostream_iterator\u003clong\u003e(cout, \" \"));\n            cout \u003c\u003c endl;\n        });\n\n    //\n    // recover lines of text from byte stream\n    //\n    \n    auto removespaces = [](string s){\n        s.erase(remove_if(s.begin(), s.end(), ::isspace), s.end());\n        return s;\n    };\n\n    // create strings split on \\r\n    auto strings = bytes |\n        concat_map([](vector\u003cuint8_t\u003e v){\n            string s(v.begin(), v.end());\n            regex delim(R\"/(\\r)/\");\n            cregex_token_iterator cursor(\u0026s[0], \u0026s[0] + s.size(), delim, {-1, 0});\n            cregex_token_iterator end;\n            vector\u003cstring\u003e splits(cursor, end);\n            return iterate(move(splits));\n        }) |\n        filter([](const string\u0026 s){\n            return !s.empty();\n        }) |\n        publish() |\n        ref_count();\n\n    // filter to last string in each line\n    auto closes = strings |\n        filter(\n            [](const string\u0026 s){\n                return s.back() == '\\r';\n            }) |\n        Rx::map([](const string\u0026){return 0;});\n\n    // group strings by line\n    auto linewindows = strings |\n        window_toggle(closes | start_with(0), [=](int){return closes;});\n\n    // reduce the strings for a line into one string\n    auto lines = linewindows |\n        flat_map([\u0026](observable\u003cstring\u003e w) {\n            return w | start_with\u003cstring\u003e(\"\") | sum() | Rx::map(removespaces);\n        });\n\n    // print result\n    lines |\n        subscribe\u003cstring\u003e(println(cout));\n\n    return 0;\n}\n```\n\n# Reactive Extensions\n\n\u003eThe ReactiveX Observable model allows you to treat streams of asynchronous events with the same sort of simple, composable operations that you use for collections of data items like arrays. It frees you from tangled webs of callbacks, and thereby makes your code more readable and less prone to bugs.\n\nCredit [ReactiveX.io](http://reactivex.io/intro.html)\n\n### Other language implementations\n\n* Java: [RxJava](https://github.com/ReactiveX/RxJava)\n* JavaScript: [rxjs](https://github.com/ReactiveX/rxjs)\n* C#: [Rx.NET](https://github.com/Reactive-Extensions/Rx.NET)\n* [More..](http://reactivex.io/languages.html)\n\n### Resources\n\n* [Intro](http://reactivex.io/intro.html)\n* [Tutorials](http://reactivex.io/tutorials.html)\n* [Marble Diagrams](http://rxmarbles.com/)\n* [twitter stream analysis app](https://github.com/kirkshoop/twitter)\n  * [![baldwin pass to wilson](https://img.youtube.com/vi/QkvCzShHyVU/0.jpg)](https://www.youtube.com/watch?v=QkvCzShHyVU)\n* _Algorithm Design For Values Distributed In Time_\n  * [![C++ Russia 2016](https://img.youtube.com/vi/Re6DS5Ff0uE/0.jpg)](https://www.youtube.com/watch?v=Re6DS5Ff0uE)\n  * [![CppCon 2016](https://img.youtube.com/vi/FcQURwM806o/0.jpg)](https://www.youtube.com/watch?v=FcQURwM806o)\n\n# Cloning RxCpp\n\nRxCpp uses a git submodule (in `ext/catch`) for the excellent [Catch](https://github.com/philsquared/Catch) library. The easiest way to ensure that the submodules are included in the clone is to add `--recursive` in the clone command.\n\n```shell\ngit clone --recursive https://github.com/ReactiveX/RxCpp.git\ncd RxCpp\n```\n\n# Installing\n\nTo install RxCpp into your OS you need to follow standart procedure:\n```shell\nmkdir build\ncd build\ncmake ..\nmake install \n```\n\nIf you're using the vcpkg dependency manager, you can install RxCpp using a single one-line command:\n\n```\nvcpkg install rxcpp\n```\n\nVcpkg will acquire RxCpp, build it from source in your computer, and provide CMake integration support for your projects.\n\nSee the [vcpkg repository](https://github.com/Microsoft/vcpkg) for more information.\n\n# Importing\n\nAfter you have successfully installed RxCpp you can import it into any project by simply adding to your CMakeLists.txt:\n```cmake\nfind_package(rxcpp CONFIG)\n``` \n\n# Building RxCpp Unit Tests\n\n* RxCpp is regularly tested on OSX and Windows.\n* RxCpp is regularly built with Clang, Gcc and VC\n* RxCpp depends on the latest compiler releases.\n\nRxCpp uses CMake to create build files for several platforms and IDE's\n\n### ide builds\n\n#### XCode\n```shell\nmkdir projects/build\ncd projects/build\ncmake -G\"Xcode\" -DRXCPP_DISABLE_TESTS_AND_EXAMPLES=0 ../CMake -B.\n```\n\n#### Visual Studio 2017\n```batch\nmkdir projects\\build\ncd projects\\build\ncmake -G \"Visual Studio 15\" -DRXCPP_DISABLE_TESTS_AND_EXAMPLES=0 ..\\CMake\\\nmsbuild Project.sln\n```\n\n### makefile builds\n\n#### OSX\n```shell\nmkdir projects/build\ncd projects/build\ncmake -G\"Unix Makefiles\" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DRXCPP_DISABLE_TESTS_AND_EXAMPLES=0 -B. ../CMake\nmake\n```\n\n#### Linux --- Clang\n```shell\nmkdir projects/build\ncd projects/build\ncmake -G\"Unix Makefiles\" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_EXE_LINKER_FLAGS=\"-stdlib=libc++\" -DRXCPP_DISABLE_TESTS_AND_EXAMPLES=0 -B. ../CMake\nmake\n```\n\n#### Linux --- GCC\n```shell\nmkdir projects/build\ncd projects/build\ncmake -G\"Unix Makefiles\" -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DRXCPP_DISABLE_TESTS_AND_EXAMPLES=0 -B. ../CMake\nmake\n```\n\n#### Windows\n```batch\nmkdir projects\\build\ncd projects\\build\ncmake -G\"NMake Makefiles\" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DRXCPP_DISABLE_TESTS_AND_EXAMPLES=0 -B. ..\\CMake\nnmake\n```\n\nThe build only produces test and example binaries.\n\n# Running tests\n\n* You can use the CMake test runner `ctest`\n* You can run the test binaries directly `rxcpp_test_*`\n* Tests can be selected by name or tag\nExample of by-tag\n\n`rxcpp_test_subscription [perf]`\n\n# Documentation\n\nRxCpp uses Doxygen to generate project [documentation](http://reactivex.github.io/RxCpp).\n\nWhen Doxygen+Graphviz is installed, CMake creates a special build task named `doc`. It creates actual documentation and puts it to `projects/doxygen/html/` folder, which can be published to the `gh-pages` branch. Each merged pull request will build the docs and publish them.\n\n[Developers Material](DeveloperManual.md)\n\n# Contributing Code\n\nBefore submitting a feature or substantial code contribution please  discuss it with the team and ensure it follows the product roadmap. Note that all code submissions will be rigorously reviewed and tested by the Rx Team, and only those that meet an extremely high bar for both quality and design/roadmap appropriateness will be merged into the source.\n\n# Microsoft Open Source Code of Conduct\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactive-extensions%2Frxcpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freactive-extensions%2Frxcpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freactive-extensions%2Frxcpp/lists"}