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
    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
    Namit Gupta
    @guptanamit_twitter
    Hello folks, I am new to reactive programming. can anyone suggest good online resources to get started on this topic.
    Jonathan Robson
    @robsonj
    Apologies if this is stupid question. As a C# dev I'm used to being able to return a disposable when creating an Observable.Create(). What is the equivalent in Java please?
    David Karnok
    @akarnokd
    @robsonj It depends on which RxJava version you are using. Generally, we stopped returning those because cancellation doesn't compose in a synchronous case.
    Jonathan Robson
    @robsonj
    @akarnokd Thanks. I think I got it. Found I was able to set the disposable (setDisposable()) on the emitter.
    Yannick Lecaillez
    @ylecaillez
    Hello guys !
    While working on a custom operator, i was wondering about the correct behavior to implement when my operator deals with a Subscriber throwing an exception on onNext().
    Reactive-streams 2#13 (https://github.com/reactive-streams/reactive-streams-jvm#2.13) says that the caller "MUST raise this error condition in a fashion that is adequate for the runtime environment."
    Reading at RxJava code, looks like onNext() invocations are never (? i admit i didn't check all operators) surrounded by try/catch.
    So i wondered if it is something planned to be included in a future RxJava or if you guys actually had a reason to not do so ?
    David Karnok
    @akarnokd
    There is no need to wrap onNext calls into try-catches. In fact, it is discouraged in RxJava 2 because it can misdirect exceptions from bugs. If you have something that can throw inside your onNext, wrap that into try-catch and don't let it escape. Btw, are you learning RxJava 2?