/** * Like {@link io.vertx.rxjava.core.shareddata.SharedData#getLock} but specifying a timeout. If the lock is not obtained within the timeout * a failure will be sent to the handler. * <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 * @param timeout the timeout in ms * @return * @deprecated use {@link #rxGetLockWithTimeout} instead */ @Deprecated() public Observable<io.vertx.rxjava.core.shareddata.Lock> getLockWithTimeoutObservable(String name, long timeout) { io.vertx.rx.java.ObservableFuture<io.vertx.rxjava.core.shareddata.Lock> resultHandler = io.vertx.rx.java.RxHelper.observableFuture(); getLockWithTimeout(name, timeout, resultHandler.toHandler()); return resultHandler; }
/** * Like {@link io.vertx.rxjava.core.shareddata.SharedData#getLock} but specifying a timeout. If the lock is not obtained within the timeout * a failure will be sent to the handler. * <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 * @param timeout the timeout in ms * @return */ public Single<io.vertx.rxjava.core.shareddata.Lock> rxGetLockWithTimeout(String name, long timeout) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { getLockWithTimeout(name, timeout, fut); })); }
/** * Like {@link io.vertx.rxjava.core.shareddata.SharedData#getLock} but specifying a timeout. If the lock is not obtained within the timeout * a failure will be sent to the handler. * <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 * @param timeout the timeout in ms * @return */ public Single<io.vertx.rxjava.core.shareddata.Lock> rxGetLockWithTimeout(String name, long timeout) { return Single.create(new io.vertx.rx.java.SingleOnSubscribeAdapter<>(fut -> { getLockWithTimeout(name, timeout, fut); })); }