Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Stephen Berger
    @GettingNifty
    Maybe the one is the second array
    Try 0
    Yannick Lecaillez
    @ylecaillez
    Ok, i'm able to produce an OOME with groupBy() :-(
    Stephen Berger
    @GettingNifty
    I'm confused
    Stephen Berger
    @GettingNifty
    I think you need to schedule it or exit somehow
    var source = Observable.Interval(TimeSpan.FromSeconds(0.1)).Take(10);
    ''var group = source.GroupBy(i => i % 3);
    group.SelectMany(
    grp =>
    grp.Max()
    .Select(value => new { grp.Key, value }))
    .Dump("group");''
    ::hh::
    How do u format
    Yannick Lecaillez
    @ylecaillez

    This is how i'm able to produce an OOME:

    ```java

    Flowable.range(2, 200_000_000)
                    .groupBy(e -> {
                        // First 100 000 000 in different group
                        if (e < 100_000_000) {
                            return e;
                        }
                        // Last 100 000 000 in the same group
                        return 1;
                    })
                    .subscribe(g -> {
                        if (g.getKey() == 1) {
                            g.subscribe(TestSubscriber.create(0));
                        } else {
                            g.subscribe(new DefaultSubscriber<Integer>() {
                                @Override
                                public void onNext(Integer t) {
                                    if (t.intValue() % 100_000 == 0) {
                                        System.out.println("Received: " + t);
                                    }
                                    Schedulers.computation().scheduleDirect(this::cancel);
                                }
    
                                @Override
                                public void onError(Throwable t) {
                                }
    
                                @Override
                                public void onComplete() {
                                }
                            });
                        }
                    });
    You have to be patient but when 100.000.000 is reached, the following 100.000.000 will be queued internally by groupBy() because of the double request() bug (?)
    Hope that helps.
    Stephen Berger
    @GettingNifty
    Can u email me that last piece of code
    I need it for a scenegraph implementation
    @ylecaillez
    Stephen Berger
    @GettingNifty
    I'm trying to move the body parts and it uses keys I need it for reference
    Stephen Berger
    @GettingNifty
    ''' var taco= new Taco();'''
    '''
    '''
    '''code'''
    Ohhh
    var code
    Dorus
    @Dorus
    Try:
    ```Java
    code
    ```
    Stephen Berger
    @GettingNifty
    java code
    I'm on mobile how do I line break
    Dorus
    @Dorus
    ctrl+\ or the button on the right on desktop. Not sure about mobile
    Stephen Berger
    @GettingNifty
    java \ code
    Hmm idk
    Dorus
    @Dorus
    I think it's not possible. You could write your text somewhere else and copy-paste it?
    That might work
    Stephen Berger
    @GettingNifty
    Ahh
    Code
    Hey
    Dorus
    @Dorus
    :+1:
    Stephen Berger
    @GettingNifty
    help
    No boots
    \help
    Gitterbot helps kinda spammy but fun
    I wish I could get the one from gamedev
    Josh from undead labs knows the guy
    Stephen Berger
    @GettingNifty
    It can solve sentences and derivations and post images
    publicocean0
    @publicocean0
    uhmm rxjava for me is like google gwt.... it is a solution too much cabled .... it is not flexible. Many modules and component but less cables predefined
    David Karnok
    @akarnokd
    GroupBy is a particularly difficult operator. Creating 100M groups by itself will use a lot of memory plus each group remains alive till the very end of the source. The current requesting pattern is conservative in a sense that certain unit test won't pass otherwise.
    Stephen Berger
    @GettingNifty
    Is it for instancing server connections?
    Troy Patrick
    @teasp00n

    I have a need to do something once a stream is subscribed to for the first time. I have written the following transformer to do it:

      public static <T> Observable.Transformer<T, T> doOnFirstSubscribe(final Action0 func) {
        return new Observable.Transformer<T, T>() {
          boolean firstSubscription = true;
          @Override
          public Observable<T> call(Observable<T> input) {
            return input.doOnSubscribe(() -> {
              if (firstSubscription) {
                func.call();
                firstSubscription = false;
              }
            });
          }
        };
      }

    i've written tests for it and they pass however during usage in my application it appears to call func when the stream is resubscribed to.

    does my transformer seem correct?

    Yannick Lecaillez
    @ylecaillez
    @akarnokd note the cancel(), invoked asynchronously. All groups but one are removed. Only the item being queued for the remaining group "1" causes the OOME.
    Ivan Schütz
    @i-schuetz
    why are doOnComplete, doOnSubscribe and doFinally never called?
    //    val obs = createObservable()
        val obs = createcompletable()
    
        @JvmStatic fun main(args: Array<String>) {
    
            this.obs.doOnSubscribe {
                println("on subscribe!")
    
            }
            this.obs.doOnComplete {
                println("complete!")
            }
    
            this.obs.doFinally{
                println("dofinally!")
            }
    
            this.obs.subscribe {
                println("subscribe!")
            }
        }
    
    
    
        fun createcompletable(): Completable =
            Completable.create{ emitter ->
    
                println("calling oncomplete")
                emitter.onComplete()
            }
    
        fun createObservable(): Observable<Void> =
    //        Observable.defer {
                Observable.create<Void> { emitter ->
    
                    println("calling oncomplete")
                    emitter.onComplete()
                }
    //        }
    + also, the subscribe block is called only when using Completable, with Observable<Void> not even that is called
    Ivan Schütz
    @i-schuetz
    p.s. for completeness, I'm asking about both Observable<Void> (which is commented in the snippet) and Completable.
    nmquyet
    @nmquyet
    Hi everyone, I am using Rxjava 2 and its hook mechanism to pass threadlocal value arround. It's work. However when calling another non blocking api (Couchbase api which uses Rxjava 1), threadlocal was lost after receiving results because couchbase receive couchbase response on its own thread. Anyone have the solution for this problem?
    Stephen Berger
    @GettingNifty
    Why are u not using a semi colon after every line
    Ivan Schütz
    @i-schuetz
    ok, in the meantime I got an answer... ReactiveX/RxJava#5510