| | |
| | | import com.forgerock.reactive.ReactiveHandler; |
| | | import com.forgerock.reactive.Stream; |
| | | |
| | | import io.reactivex.exceptions.OnErrorNotImplementedException; |
| | | import io.reactivex.internal.util.BackpressureHelper; |
| | | |
| | | /** |
| | |
| | | return newCompletable(new Completable.Emitter() { |
| | | @Override |
| | | public void subscribe(final Completable.Subscriber s) throws Exception { |
| | | promise.thenOnResult(new ResultHandler<Boolean>() { |
| | | promise.thenOnResult(new ResultHandler<Boolean>() { |
| | | @Override |
| | | public void handleResult(Boolean result) { |
| | | s.onComplete(); |
| | |
| | | }).thenOnException(new ExceptionHandler<Exception>() { |
| | | @Override |
| | | public void handleException(Exception exception) { |
| | | s.onError(exception); |
| | | try { |
| | | s.onError(exception); |
| | | } catch (Throwable t) { |
| | | if (!(t instanceof OnErrorNotImplementedException)) { |
| | | throw t; |
| | | } |
| | | } |
| | | } |
| | | }).thenOnRuntimeException(new RuntimeExceptionHandler() { |
| | | @Override |
| | |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | } |
| | | } |