Examples of ObserveRequest


Examples of com.couchbase.client.core.message.kv.ObserveRequest

                    .flatMap(new Func1<Integer, Observable<ObserveResponse>>() {
                        @Override
                        public Observable<ObserveResponse> call(Integer replicas) {
                            List<Observable<ObserveResponse>> obs = new ArrayList<Observable<ObserveResponse>>();
                            if (persistTo != PersistTo.NONE) {
                                obs.add(core.<ObserveResponse>send(new ObserveRequest(id, cas, true, (short) 0, bucket)));
                            }

                            if (persistTo.touchesReplica() || replicateTo.touchesReplica()) {
                                if (replicas >= 1) {
                                    obs.add(core.<ObserveResponse>send(new ObserveRequest(id, cas, false, (short) 1, bucket)));
                                }
                                if (replicas >= 2) {
                                    obs.add(core.<ObserveResponse>send(new ObserveRequest(id, cas, false, (short) 2, bucket)));
                                }
                                if (replicas == 3) {
                                    obs.add(core.<ObserveResponse>send(new ObserveRequest(id, cas, false, (short) 3, bucket)));
                                }
                            }
                            return Observable.merge(obs);
                        }
                    });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.