/** * Get an asynchronous lock with the specified name. The lock will be passed to the handler when it is available. * <p> * In general lock acquision is unordered, so that sequential attempts to acquire a lock, * even from a single thread, can happen in non-sequential order. * </p> * @param name the name of the lock * @return * @deprecated use {@link #rxGetLock} instead */ @Deprecated() public Observable<io.vertx.rxjava.core.shareddata.Lock> getLockObservable(String name) { io.vertx.rx.java.ObservableFuture<io.vertx.rxjava.core.shareddata.Lock> resultHandler = io.vertx.rx.java.RxHelper.observableFuture(); getLock(name, resultHandler.toHandler()); return resultHandler; }
/** * Get an asynchronous lock with the specified name. The lock will be passed to the handler when it is available. * <p> * In general lock acquision is unordered, so that sequential attempts to acquire a lock, * even from a single thread, can happen in non-sequential order. * </p> * @param name the name of the lock * @return */ public Single<io.vertx.rxjava.core.shareddata.Lock> rxGetLock(String name) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { getLock(name, fut); })); }
/** * Get an asynchronous lock with the specified name. The lock will be passed to the handler when it is available. * <p> * In general lock acquision is unordered, so that sequential attempts to acquire a lock, * even from a single thread, can happen in non-sequential order. * </p> * @param name the name of the lock * @return */ public Single<io.vertx.rxjava.core.shareddata.Lock> rxGetLock(String name) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { getLock(name, fut); })); }