Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Javier Domingo Cansino
    @txomon
    it's enough
    knowing that I can use a Subject as a Create now, publish later is enough for me
    Dorus
    @Dorus
    That one uses a Observer<Observable<Integer>>, but it's easy to replace it with an Observer<String> or whatever.
    Javier Domingo Cansino
    @txomon
    yeah yeah
    it's just what I needed
    thank you!
    Dorus
    @Dorus
    :)
    And now dont go abuse Subjects. Share them as Observer if at all.
    Javier Domingo Cansino
    @txomon
    hahaha suuuure....
    xD
    nah, anyway, I now need to know what should I do
    because I feel like creating an Observable for each config value is maybe overkill
    and I should maybe generate something like ConfigurationObservable
    and have Map<String,Object> passed around
    each one publishing it's values, and then using a combineLatest in the BS
    and have a bs.getConfigurationObservable(List<String> interestingConfigs) function
    so that it only receives the values from those interestings ones
    Javier Domingo Cansino
    @txomon
    that way the BS is in charge of deciding what sort of items should emit...
    Dorus
    @Dorus
    How offten do config values change?
    Javier Domingo Cansino
    @txomon
    @Dorus not really frequently, but I want to do everything reactive, because I might implement backends in the app, so config sources may vary and be changed anytime really
    so having the UI change the config value, would mean actually almost the same as the backend changing it
    Leander Kurscheidt
    @LeanderK
    is there a web framework, where the answer is decoupled from the request, so that i can have observable streams of the requests and zip some, map some and in the end answer them with the result
    Abhinav Solan
    @eyeced
    Hi all, I am trying this code
    Observable.just(1, 2, 3, 4, 5, 6)
    .groupBy(i -> i % 3)
    .flatMap(o -> o.first())
    .subscribe(System.out::println);
    Now this should have just got me (1, 2, 3) as the result but it is giving
    1
    2
    3
    4
    5
    6
    Dorus
    @Dorus
    Possibly, first() unsubscribes so groupBy recreate the group?
    Try .distinct(i -> i % 3) instead.
    Abhinav Solan
    @eyeced
    is that a bug ?
    Dorus
    @Dorus
    I'm not 100% sure. Let me test what Rx.Net does.
    yup, Rx.Net gives 1,2,3 as expected.
    I would suggest you fill a bug and see what the devs say about this. Seems fishy.
    Abhinav Solan
    @eyeced
    ok thanks
    Dorus
    @Dorus
    #3411
    Dorus
    @Dorus
    I've read up on it a bit, ther's something to say for both implementations. The Rx.Net variant is the one you would expect, but the RxJava has some uses too. Mainly not leaking resources.
    Artem Zinnatullin :slowpoke:
    @artem-zinnatullin
    @LeanderK hadn't seen any Web frameworks with RxJava in the core, but there are a lot with non blocking io so you can pretty easily integrate them with RxJava
    Leander Kurscheidt
    @LeanderK
    any recommendations?
    Artem Zinnatullin :slowpoke:
    @artem-zinnatullin
    @LeanderK well, I don't want to give any particular recommendations because it should be your own choice, personally, I prefer little bit more low level things like Netty (and there is RxNetty). Please just google web frameworks with non-blocking io and try some of them :)
    Javier Domingo Cansino
    @txomon
    hmmm thinking about how to make a reactive repository pattern, I had thought about having the repo send a Observable<List<Item>>, and sending an Observable<Item> that would send the updates for each item
    of course, in my business logic, I would need to convert the Observable<List<Item>> into a stream of Observable<Item>, and concat the updates from Observable<Item>
    but I have no idea on how to do it :(
    Michael Nitschinger
    @daschl
    @txomon can you explain a little more?
    happy to help :)
    Javier Domingo Cansino
    @txomon
    @daschl so I have a set of items that can be updated
    Michael Nitschinger
    @daschl
    okay, can you show me some simple API or so?
    Javier Domingo Cansino
    @txomon
    the design I have come up with would be
    sure
    public interface ContactRepository {
        Observable<List<Contact>> getContactList();
    
        Observable<Contact> getContactUpdates();
    }
    Michael Nitschinger
    @daschl
    okay
    so let me ask something
    Javier Domingo Cansino
    @txomon
    (I have deleted the other call which isn't interesting for the usecase)
    Michael Nitschinger
    @daschl
    okay gotcha I think, so whats the problem from there?