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

Better usage examples #167

Open
agg23 opened this issue Nov 24, 2021 · 7 comments
Open

Better usage examples #167

agg23 opened this issue Nov 24, 2021 · 7 comments

Comments

@agg23
Copy link

agg23 commented Nov 24, 2021

I have been trying to figure out this library on and off for a few months, and its complexity and lack of examples has been quite a challenge. I would love to see how people are managing lifetimes and threading with types like SharedSubject.

@jsoverson
Copy link

That would be so valuable. This project looks great but I'm having a difficult time figuring out how to use it fully.

@utilForever if we could get some basic snippets that show examples of custom observables/observers, usage of SharedSubject & LocalSubject, passing observables around safely, how to use Connectable, etc; the community can turn those into documentation quickly.

Right now I'm not sure if there are parts of the project I'm misusing or are missing and I should figure out how to add and submit a PR.

One scenario I'm having difficulty with: I need a Subject that I can store, clone(), push to (via next()), subscribe to (via subscribe()), and pass safely across threads. That sounds like a lot but it also sounds like something that is probably solved and I just need to find the way to do it.

@M-Adoo
Copy link
Collaborator

M-Adoo commented Sep 28, 2022

@agg23 @jsoverson thanks for your comments. I'm sorry for replying late and not provide a better documents. I am not satisfied with the current implementation for local & shared, it's too complicated, I plan to refactor it and then update the docs, but it'll not coming soon, because I'm focusing on an another big library these months which used rxRust.

@agg23 For a not static lifetime, I removed the support of SharedSubject, because the old API not easy to use, nor completely safe.

@jsoverson you can use SharedSubject, call into_shared before subscribe to keep it work on a shared version.

@jsoverson
Copy link

Thanks for the reply @M-Adoo. I'm still having trouble figuring out how to use rxRust. I'm trying to use it as the rx implementation for a reactive streams project but I can't make any meaningful progress. Are you in any chat/discord/etc servers? If I can just get productive I'll be able to contribute a bunch of docs and usage examples via the dependent project.

@c608345
Copy link

c608345 commented Dec 30, 2022

@jsoverson There are some tutorials about reactive programming.
https://reactivex.io/intro.html

@utilForever
Copy link
Contributor

That would be so valuable. This project looks great but I'm having a difficult time figuring out how to use it fully.

@utilForever if we could get some basic snippets that show examples of custom observables/observers, usage of SharedSubject & LocalSubject, passing observables around safely, how to use Connectable, etc; the community can turn those into documentation quickly.

Right now I'm not sure if there are parts of the project I'm misusing or are missing and I should figure out how to add and submit a PR.

One scenario I'm having difficulty with: I need a Subject that I can store, clone(), push to (via next()), subscribe to (via subscribe()), and pass safely across threads. That sounds like a lot but it also sounds like something that is probably solved and I just need to find the way to do it.

Hmm... I'm using this library in an in-house project. I'll add some examples soon.

@hillin
Copy link

hillin commented Sep 1, 2023

I'm struggling to find an idiomatic way to write down the type of observables. For example, if I create a complex observable by chaining many operators, and decide to store it in a struct for further use (instead of subscribing immediately so I can store it in a local variable and let the type inference do the job for me), how should I write the type of the said observable?

@zoechi
Copy link

zoechi commented Jan 9, 2024

@hilin a bit late, but look for .box_it() and BoxOp<T,Err>

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

7 participants