/** * 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 * @param resultHandler the handler */ public void getLock(String name, Handler<AsyncResult<io.vertx.rxjava.core.shareddata.Lock>> resultHandler) { delegate.getLock(name, new Handler<AsyncResult<io.vertx.core.shareddata.Lock>>() { public void handle(AsyncResult<io.vertx.core.shareddata.Lock> ar) { if (ar.succeeded()) { resultHandler.handle(io.vertx.core.Future.succeededFuture(io.vertx.rxjava.core.shareddata.Lock.newInstance(ar.result()))); } else { resultHandler.handle(io.vertx.core.Future.failedFuture(ar.cause())); } } }); }
/** * 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 * @param resultHandler the handler */ public void getLock(String name, Handler<AsyncResult<io.vertx.rxjava.core.shareddata.Lock>> resultHandler) { delegate.getLock(name, new Handler<AsyncResult<io.vertx.core.shareddata.Lock>>() { public void handle(AsyncResult<io.vertx.core.shareddata.Lock> ar) { if (ar.succeeded()) { resultHandler.handle(io.vertx.core.Future.succeededFuture(io.vertx.rxjava.core.shareddata.Lock.newInstance(ar.result()))); } else { resultHandler.handle(io.vertx.core.Future.failedFuture(ar.cause())); } } }); }
/** * 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 * @param resultHandler the handler */ public void getLockWithTimeout(String name, long timeout, Handler<AsyncResult<io.vertx.rxjava.core.shareddata.Lock>> resultHandler) { delegate.getLockWithTimeout(name, timeout, new Handler<AsyncResult<io.vertx.core.shareddata.Lock>>() { public void handle(AsyncResult<io.vertx.core.shareddata.Lock> ar) { if (ar.succeeded()) { resultHandler.handle(io.vertx.core.Future.succeededFuture(io.vertx.rxjava.core.shareddata.Lock.newInstance(ar.result()))); } else { resultHandler.handle(io.vertx.core.Future.failedFuture(ar.cause())); } } }); }
/** * 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 * @param resultHandler the handler */ public void getLockWithTimeout(String name, long timeout, Handler<AsyncResult<io.vertx.rxjava.core.shareddata.Lock>> resultHandler) { delegate.getLockWithTimeout(name, timeout, new Handler<AsyncResult<io.vertx.core.shareddata.Lock>>() { public void handle(AsyncResult<io.vertx.core.shareddata.Lock> ar) { if (ar.succeeded()) { resultHandler.handle(io.vertx.core.Future.succeededFuture(io.vertx.rxjava.core.shareddata.Lock.newInstance(ar.result()))); } else { resultHandler.handle(io.vertx.core.Future.failedFuture(ar.cause())); } } }); }