Serhad Burakan Serhad Burakan - 1 year ago 161
reST (reStructuredText) Question

Rest Service with Java Observable from Executer Service

I have a rest web service which returns DeferredResults. I implemented JavaRx Observable from executer service that returns Future. I wanted this web service to be non blocking but it seems it is blocking the operation.

Do you think the way I used executer service is healthy?

DeferredResult result = new DeferredResult();
Observable<ResultEntity> observable = Observable
observable.subscribe(new Subscriber<ResultEntity>() {
public void onCompleted() {


public void onError(Throwable throwable) {

public void onNext(ResultEntity r) {



Answer Source

Observable.from(Future) is blocking operation, as mentioned in documentation. You should use Observable.from(Future,Scheduler) instead.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download