Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Heikki Vesalainen
    @hvesalai
    So like this?
    Flowable.just(initialState).compose(FlowableTransformers.expand(s -> generator(s).toFlowable)).skip(1)
    David Karnok
    @akarnokd
    Yes.
    Heikki Vesalainen
    @hvesalai
    with the .skip(1) because I don't want to emit the initialState
    David Karnok
    @akarnokd
    It's up to you what you do with the elements after compose.
    Heikki Vesalainen
    @hvesalai
    so how does that actually work?
    What is compose
    David Karnok
    @akarnokd
    For such single element, you'd want to use ExpandStrategy.BREATH_FIRST as it doesn't have to keep a stack of open sequences.
    compose let's you apply operators without leaving the fluent style of specifying operators. It takes a transformer function that is called with the assembled stream that far and should return a new stream with added operators/behavior.
    Heikki Vesalainen
    @hvesalai
    Ok, and so then FlowableTransformers.expand emits the values of the original stream and for each value recursively calls the expand function to create more values until there is nothing to expand
    David Karnok
    @akarnokd
    yes
    Heikki Vesalainen
    @hvesalai
    And does it does not create values before they are requested?
    This is your code outside the RxJava library. Is there any intention to have this be included in the core library?
    David Karnok
    @akarnokd
    It honors backpressure so it follows the demand from your downstream.
    The Extensions library is the holding place for uncommon, rare or otherwise peculiar operators that are currently unlikely to be included in RxJava itself.
    Heikki Vesalainen
    @hvesalai
    Uh... I thought my scenario was very normal.
    Heikki Vesalainen
    @hvesalai
    Any drawback in doing this:
    Flowable<Long> fib(Long i, Long j) {
      return Flowable.concat(Flowable.just(i), Flowable.defer(() -> fib(j, i+j)));
    }
    Heikki Vesalainen
    @hvesalai
    Is there a way to implement static <T> Pair<Flowable<T>, Flowable<T>> split(Flowable<T> source, long at), i.e the first at elements to the first Flowable and the rest to the next Flowable? So that it all subscribes to the source flowable only once.
    If I do simply new Pair(source.take(at), source.skip(at)), wouldn't that subscribe to source twise?
    Heikki Vesalainen
    @hvesalai
    Or am I thinking about this in a totally wrong way?
    Heikki Vesalainen
    @hvesalai
    What I specifically want now is to do an operator that returns the original publisher if it is not empty and if it is empty, returns an other publisher.
    Israel Fernández
    @iferca
    I'm working on the migration of an RxJava 1.x project to RxJava 2.x, any good post/doc on the differences you can point me to? Migration guide maybe?
    Punita Ojha
    @punitaojha
    This message was deleted
    Hristo Hristov
    @pentarex
    hey rx gurus (newbie here), I have a question. I have Observable.just(list) and inside i have zip, how can i do if one of the observables in the zip failes to repeat it. This is my code https://pastebin.com/qDPgNknf
    and if it fails to repeat it and also to pass different parameters to the function. I guess .repeat() is not going to work in this case
    Jamie Chapman
    @chapinchs_twitter
    Hi all
    Hristo Hristov
    @pentarex
    hi
    Jamie Chapman
    @chapinchs_twitter
    So question for the room, I have created a hangman game web app using spring-boot, but I’d like to covert this to use ReactiveX, I know spring are adding support for this but do any other framworks currently support it, I’ve heard play does are there any others?
    Heikki Vesalainen
    @hvesalai
    The Flowable interface is rather cluttered. It would be nice if there was an interface with just the bare minimum primitives. Would make reading the API easyer.
    Mark Elston
    @melston
    I posted a question to StackOverflow last Sunday but haven't got any responses to it there. It was framed in a Rx.NET setting but a RxJava solution would be helpful as well.

    It relates to removing repeated regions from a stream of data. TakeUntil won't work since it stops the stream after the first sentinal value and I just want to filter out data between every pair of sentinal values.

    Any ideas how to do this in RX?

    Heikki Vesalainen
    @hvesalai
    @melston you can do it with scan, can't you
    Heikki Vesalainen
    @hvesalai
    yourPublisher.scan('b', (s, v) -> if (v == 'a' || v == 'b' || s != 'a') v else s).filter(v -> v != 'a' && v != 'b');
    (edited my answer above)
    Heikki Vesalainen
    @hvesalai
    @melston also posted it to stackoverflow
    Mark Elston
    @melston
    Thanks, @hvesalai . I wasn't aware of how Scan worked so I completely bypassed it in my search. I think that will do nicely.
    Rémon S.
    @Coffee2CodeNL
    Hey people :D
    I'm wondering, what's a proper way to implement a plugin system that can add observables to the chain programatically? say i've got a List<Observable>, how could i add those to the chain?
    Rémon S.
    @Coffee2CodeNL
    I'm guessing flatmap and a for loop?
    Rémon S.
    @Coffee2CodeNL
    Anyone?
    Mark Elston
    @melston
    @iSDP , I'm not sure what you are trying to do but have you tried the Concat or Merge operators?
    Heikki Vesalainen
    @hvesalai
    @iSDP you mean an Observable<Observable<T>> ?
    then it would be a flatMap
    Rémon S.
    @Coffee2CodeNL
    @melston @hvesalai I'm trying to create a Plugin system, I've got an observable that emits an Update object, and depending on what the Update object contains, I want those plugins to be able to act on it
    I'm building a Telegram Bot API Library based on RxJava2 and Retrofit
    That observable that emits those Update objects is a long polling mechanism
    I want end users to be able to hook their own plugins into the "chain"
    The Update object gets passed on nonetheless
    Heikki Vesalainen
    @hvesalai
    so why wouldn't the plugins just subscribe to the same observable?
    Rémon S.
    @Coffee2CodeNL
    So that means the Update Observable would become a connectable?
    I'm kinda still wrapping my head around this whole reactive business
    Heikki Vesalainen
    @hvesalai
    refcount
    Rémon S.
    @Coffee2CodeNL
    refcount?