Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Artem Zinnatullin :slowpoke:
    @artem-zinnatullin
    Observable.from(future) should work fine for you
    Dorus
    @Dorus
    Also, try not to switch between the two worlds every time, pick one and stay in it.
    At least that's what i always hear when ther's a discussing on alternate async interfaces.
    Josh Durbin
    @joshdurbin
    Yeah, at this point I prefer to use the Rx interfaces.
    Jake Luciani
    @tjake
    Hi, what techniques are there to try and debug/visualize the current stack, i find this the toughest part of reactive programming
    seems like logging/tracing are the options
    Jake Luciani
    @tjake
    @AdamCopperfield why is it specific to android?
    Rudi Grinberg
    @rgrinberg
    Suppose I have an observable created using a retrofit call and I’d like to run on onCreate and onResume. But only run in onResume if onCreate wasn’t just triggered. Is there an rx way to accomplish this?
    Alexander Shtanko
    @AlexanderShtanko
    Hi! Can you help me? Is there in rxjava repeat operator with condition?
    Simon Baslé
    @simonbasle
    hi, what would the condition be on?
    there's a repeatWhen variant, but I'm not sure it fits your need
    Alexander Shtanko
    @AlexanderShtanko
    repeat operator with simple condition, for example value==true
    Simon Baslé
    @simonbasle
    where would the value come from? the problem with repeatWhen is that the repetition is triggered when the source observable completes, so you cannot directly choose to repeat according to a value emitted by said observable
    unless your source observable mutates some external synchronized state (like an AtomicBoolean)
    also, are you sure you want repeat and not retry?
    (I mean, is this a case of really repeating an Observable that completed normally, or the condition could be seen as an error and you want to retry the whole source logic)
    Alexander Shtanko
    @AlexanderShtanko
    I want to repeat rest request until I get response with right status
    Value come from BehaviorSubject.getValue()
    Dorus
    @Dorus
    use retry then.
    Alexander Shtanko
    @AlexanderShtanko
    ОK, thanks, I will try
    Dorus
    @Dorus
    source.flatMap(e -> BehaviorSubject(...)
    .flatMap(e -> {
        if (wrongValue) {
            return Observable.error(...)
        }
        return Observable.just(e);
    ).retry())
    Something among those lines.
    Simon Baslé
    @simonbasle
    yep, retry combined with Observable.error would seem a better fit
    Alexander Shtanko
    @AlexanderShtanko
    OK)
    Josh Durbin
    @joshdurbin

    Hey Gang. Question:

    I’ve had something on here a bit ago regarding the conversion of Elasticsearch Futures to Observables. I’ve got all that working, but now I want to map search ‘hits’ to a particular domain object. It appears the Java ES API does not support codecs, so I thought I’d map over the observables. One hiccup, though, the observable is a wrapper that contains another data in addition to a list of Hits.

    In this API, I’m converting a Future<SearchResponse> to Observable<SearchResponse>. SearchResponse has a variable, class SearchHits, which itself has a list (or array, more accurately) of type SearchHit.

    So, from search response: searchResponse.getHits().hits() returns SearchHit[].

    How do I map a single searchResponse such that it emmits each individual SearchHit?

    Josh Durbin
    @joshdurbin
    To put another way, what’s the best way of taking a single observable, accessing a member of the observable and emitting an observable of a different type, preferrably via an iterable
    Dorus
    @Dorus
    ToBlocking ?
    (im making wild guesses here)
    Alessandro Vermeulen
    @spockz
    Where does someObservable.toBlocking().toFuture() block? Many methods on this page describe blocking. In the description of toFuture() blocking isn't mentioned.
    From what I see in the code, it doesn't block. But it would be nice if this could be confirmed
    Michael Nitschinger
    @daschl
    @spockz toBlocking never actually blocks
    it just converts it into a BlockingObservable
    it only blocks on the actual methods, like toBlocking().single() (uses a latch there)
    or when you convert it into an iterable
    Alessandro Vermeulen
    @spockz
    @daschl that is what I reckoned
    Simon Baslé
    @simonbasle
    @spockz @daschl toFuture uses a single on your source to enforce the contract of a single value, and will block if you call get(), block for a maximum of timeout and throw TimeoutException if you call get(timeout, timeUnit)
    but otherwise will behave asynchronously
    Edoardo Vacchi
    @evacchi
    hi guys is there already an ETA for 2.0 ?
    Pesaply Engineering
    @pesaply
    Need Help Here I Like To Run This mvn -e test-compile exec:java -Dexec.classpathScope="test" -Dexec.mainClass="com.opes.smpp.server.ServerMain" how can i do that
    Javier Domingo Cansino
    @txomon
    @Hojalab wrong channel =)
    Pesaply Engineering
    @pesaply
    Sorry i know
    Javier Domingo Cansino
    @txomon
    besides, I have no idea xD so can't help you
    Pesaply Engineering
    @pesaply
    Sorry i wanna run java application on a server , running on background
    so when i close a terminal it runs as a daimon
    Javier Domingo Cansino
    @txomon
    (Still have no idea, but) IIRC if you want to run a java app, you basically run it with java, like java -jar myApp.jar
    maven is just a compilation tool, so after compiling with mvn, you should get a .jar from there and execute it with java
    txomon @txomon is going bed now...
    Pesaply Engineering
    @pesaply
    Its Working fine , but when i close my terminal the program close too ,, i like to make it run forever on background , am using cloud server
    Simon Baslé
    @simonbasle
    @Hojalab this is more of an OS question then...