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
    hmmm
    Michael Nitschinger
    @daschl
    so it always keeps the latest state emitted for the object
    @txomon your for loop has o(N) complexity while the hash replace is just O(1)
    Javier Domingo Cansino
    @txomon
    @daschl yeah, but I need it in order
    Michael Nitschinger
    @daschl
    okay, then maybe use a queue where you can push/pop?
    Javier Domingo Cansino
    @txomon
    but items are not updated in order
    Michael Nitschinger
    @daschl
    so what order do you need?
    Javier Domingo Cansino
    @txomon
    yes, I have just realized I haven't described the app
    Michael Nitschinger
    @daschl
    Note that there is also a TreeMap which sorts the keys by its Comparator
    Javier Domingo Cansino
    @txomon
    the app is meant to be a view of your contacts, where instead of being ordered by alphabetical order or so, it's ordered by the latest updated
    such as the call app in android, which shows the recently contacted ones
    Michael Nitschinger
    @daschl
    @txomon implement the comparable on that property and use a https://docs.oracle.com/javase/7/docs/api/java/util/TreeSet.html
    so your set will be ordered by the update date
    Dorus
    @Dorus
    @txomon This somehow remind me of DynamicData. It's in C# but it also has observable collections, might give you some ideas.
    Javier Domingo Cansino
    @txomon
    oh so instead of ordering them by the Container you use, you order them by a property of the object
    ok
    Michael Nitschinger
    @daschl
    so you get an automatic updating list of contacts which emits a new version of itself on every change!
    Javier Domingo Cansino
    @txomon
    also, @daschl how may I have that hashmap in my business logic?
    Michael Nitschinger
    @daschl
    like in my example above
    instead of your scan use mine, but use the TreeSet
    Javier Domingo Cansino
    @txomon
    hmmm but that doesn't let me create a layer above that...
    Michael Nitschinger
    @daschl
    why?
    Javier Domingo Cansino
    @txomon
    let me think about it
    Javier Domingo Cansino
    @txomon
    so ListViewAdapter needs a list underneath, which I should ping when the dataset is updated
    @daschl but isn't generating a new list...
    ohhhh
    ok
    so I am not really generating a new list each time
    is just that I am getting pinged when it updates
    ok
    let me have a look on that...
    @daschl so can that list be stored in the class rather than in the pipeline?
    I suppose it can...
    Michael Nitschinger
    @daschl
    what do you mean?
    Javier Domingo Cansino
    @txomon
    nah, just java problems, I can substitute the new HashMap by a reference to an internal variable =)
    Michael Nitschinger
    @daschl
    heh okay.. gotta run for now I hope I could help
    Javier Domingo Cansino
    @txomon
    indeed! thank you very much!
    Michael Nitschinger
    @daschl
    cheers
    if you are looking for a database which has an rx SDK, ping me ;)
    Javier Domingo Cansino
    @txomon
    haha ok!
    @Dorus indeed it looks like it
    Artem Kholodnyi
    @defHLT
    hi #rxjava. I'm a little loss here.. How do I implement an observable that supports backpressure?
    Javier Domingo Cansino
    @txomon
    @mlatu you mean observer?
    just in the subscription pipeline, specify the backpressure clauses
    like myObservable.onBackPressureDrop().subscribe(mySubscriptor)
    Artem Kholodnyi
    @defHLT
    @txomon Thanks, but I'm aware of onBackPressureDrop and ..Buffer. I'm creating an observable that calls subscriber.onNext() too often and I've got MissingBackpressureException. I'd like to make my observable honor backpressure and not to call subscriber.onNext() until more items are requested
    Javier Domingo Cansino
    @txomon
    @mlatu maybe you are looking for retry() ?
    Dorus
    @Dorus
    I think he want to create his own observable, with backpreasure support.
    Not something i'm familiar with either, but i should swear there would be tutorials on that subject. Cant find them however.