50 billion devices will be connected to the Internet by 2020. Many of them will belong to national critical infrastructure (smart power grids, smart roads, smart hospitals, smart cities) – forming the Industrial Internet of Things (IIoT). These devices will generate data streams that will need to be correlated, merged, filtered, and analyzed in real-time. This talk will explore an elegant solution to this problem that is productive, composable, concurrency-friendly, and scales well. We utilize OMG’s Data Distribution Service for Real-Time Systems (DDS) standard for connectivity, and Reactive Extensions (Rx) for functional-style composable asynchronous data processing in modern C++.
Rx is a generalization of futures and can be thought of as the async equivalent of C++ ranges. It helps create asynchronous data processing pipelines by chaining reusable higher-order functions (map, filter, flatmap, zip etc.) that rely on a common abstraction called an Observable (a continuation monad). RxCpp makes wonderful use of functional programming features in modern C++ including generic lambdas, type inference, variadic templates, and more.
Conceptually, Rx is a generalization of futures. It lets programmers create asynchronous data processing pipelines (dataflow) from a number of reusable higher-order functions (map, filter, flatmap etc.) that share a common abstraction called an Observable. In many ways, Rx is an “async equivalent of C++ ranges”. Rx is one of the best libraries that truly highlights the power of functional design principles applied in object-oriented programming languages.
DDS and Rx work great together because they are both reactive, use the publish-subscribe paradigm, and facilitate loose coupling between components. This presentation will discuss Rx4DDS [link=http://bit.ly/cppcon-rx4dds], which is a research library that integrates Rx with RTI Connext DDS. Rx4DDS enables a clean, distributed, asynchronous dataflow architecture for stream processing and is available in C#, C++, and JavaScript.
References:
[1] Rx4DDS [link=
http://bit.ly/cppcon-rx4dds]
[2] Reactive Programming with DDS and Rx [slides: see above] [video=https://vimeo.com/125712582]