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
    '''
    '''
    '''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?
    The Function can throw so it is wrapped and managed. onNext should not throw as the specification mandates thus is not wrapped.
    Yannick Lecaillez
    @ylecaillez
    Yes i'm on RxJava 2. So this reactive-streams rule is not applied because it can misdirect exceptions from bugs ?
    In my operator i wrap subscriber.onNext() between try/Catch and invoke RxJavaPlugins.onError(t); if onNext() throwed an exception.
    Sure onNext() should never throws but as stated by the rule 2.13 we should also report error when this happens:
    "Calling onSubscribe, onNext, onError or onComplete MUST return normally [...] In the case that this rule is violated, any associated Subscription to the Subscriber MUST be considered as cancelled, and the caller MUST raise this error condition in a fashion that is adequate for the runtime environment."
    David Karnok
    @akarnokd
    The rule says onNext should return normally. If it throws, that's something the concrete implementation has to handle in some way. RxJava 2 doesn't capture such exceptions which then bubble in the current thread, eventually hitting an uncaught exception handler. RxJava 2 trusts the operator implementations, why don't you?
    Yannick Lecaillez
    @ylecaillez
    I trust operator implementations, i'm more concerned by 3rd party/user's subscribers. i.e: flowable.map(..).filter(..).subscribe(t -> throw IllegalStateException());
    But as you said this error will eventually hit some exception handler. This is what i've missed.
    David Karnok
    @akarnokd
    Lambdas are not trusted, that subscribe call will end up in the global error handler anyway. Also there is the safeSubscribe() method that guards against the very nasty consumers.
    Yannick Lecaillez
    @ylecaillez
    Got it ! Thank you for your time.