Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation request: provide examples for C++ that match examples from the "Intro to Rx" article #597

Open
bert-laverman opened this issue Jan 6, 2023 · 2 comments

Comments

@bert-laverman
Copy link

I am kind of struggling to translate the Intro to Rx article into something that will help me use RxCpp. I am not looking for examples that parallel the ranges examples, but rather on how to construct my own observables, oberservers, and (more likely) subjects.

As background: I have a library that will need to process an asynchronous data stream, where the underlying API is a given. No API call is synchronous. Any response, error or reply, comes in through a message stream and is handed off to a callback that I can register with the API. The callback has to check what kind of message it has followed by message-specific attempts to match the message to a previous request. What appears to work well in C# using the .Net version of Rx, is registering collections of Subjects for each kind of message. Then the message dispatcher can just look up the collection of subscribers and call OnNext, OnError, or OnCompleted as needed. The user of my library can perform any request needed, receiving an Observable that it can subscribe to, or if the reply is known to be a single message, do a blocking Get().

I would have expected to be able to use the same approach in C++, but cannot find any hints on how to use RxCpp in this manner. The namespace structure does not match the packages in C# or Java and many of the classes from those implementations I cannot find. The online Doxygen documentation for most RxCpp classes looks pretty empty.

@victimsnino
Copy link
Collaborator

Hi

Documentation for all operators can be found in operators namespace

Rest part of the RxCpp has worse documentation.

If it is applicable for you, you can use ReactivePlusPlus documentation (ReactivePlusPlus is re-implementation of RxCpp on C++20). Most of the documentation and details are absolutely applicable to RxCpp

@bert-laverman
Copy link
Author

Thank you. Operators were the last part for me to look at, as my library will produce observables or receive observers, rather than use them. I'll have a look at ReactivePlusPlus and the documentation. C++20 is my own target, so I hope you don't mind if I check it out a bit further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants