Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    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...
    (presents solutions from most basic like nohup JAVACOMMAND & to systemd scripts)
    Javier Domingo Cansino
    @txomon
    @Hojalab the best is probably to use systemd job or something
    supervisord etc.
    Lech Głowiak
    @LGLO
    Hello All!
    I come with question. I have Subscription that reads sth from some resource. That resource becomes unavailable but there is a hope it's just temporarily (that is RabbitMQ auto-recoverable channel). Should subscription.onError be called immediately or maybe after some timeout? Or maybe behaviour should depend on signalled demand?
    Javier Domingo Cansino
    @txomon
    @LGLO I would do it calling an onError, put in the pipeline a retry, for example to retry twice and then fail. Take into account that onError is meant to be used for fatal errors, stuff you can handle should be used through standard onNext
    (my advice)
    Lech Głowiak
    @LGLO
    I'm not sure if I follow you.
    that is for an error that should be retried always
    Lech Głowiak
    @LGLO
    Ok, thank you!
    Dorus
    @Dorus
    Also be careful to put the retry close to the source, some operators (like observeOn) delete queued message when they get an onError.
    Javier Domingo Cansino
    @txomon
    that is why I said that onError is just for fatal errors
    understanding fatal as closing the app
    Dorus
    @Dorus
    Nah, fatal errors you can throw from your functions like subscribe. These should bring down your app as per Rx guidelines.
    onError on the other hand is nothing more than a function that throws an exception.
    IMHO it's a bit of a bug that RxJava assumes onError to be more fatal than that.
    Also last time i made a bug report for that i was told it would be configurable in the next version.