Search in sources :

Example 1 with RedissonBucket

use of org.redisson.RedissonBucket in project redisson by redisson.

the class BucketGetAndDeleteOperation method commit.

@Override
public void commit(CommandAsyncExecutor commandExecutor) {
    RedissonBucket<V> bucket = new RedissonBucket<V>(codec, commandExecutor, name);
    bucket.getAndDeleteAsync();
    RedissonLock lock = new RedissonTransactionalLock(commandExecutor, lockName, transactionId);
    lock.unlockAsync(getThreadId());
}
Also used : RedissonLock(org.redisson.RedissonLock) RedissonTransactionalLock(org.redisson.transaction.RedissonTransactionalLock) RedissonBucket(org.redisson.RedissonBucket)

Example 2 with RedissonBucket

use of org.redisson.RedissonBucket in project redisson by redisson.

the class BucketSetOperation method commit.

@Override
public void commit(CommandAsyncExecutor commandExecutor) {
    RedissonBucket<V> bucket = new RedissonBucket<V>(codec, commandExecutor, name);
    if (timeToLive != 0) {
        bucket.setAsync((V) value, timeToLive, timeUnit);
    } else {
        bucket.setAsync((V) value);
    }
    RedissonLock lock = new RedissonTransactionalLock(commandExecutor, lockName, transactionId);
    lock.unlockAsync(getThreadId());
}
Also used : RedissonLock(org.redisson.RedissonLock) RedissonTransactionalLock(org.redisson.transaction.RedissonTransactionalLock) RedissonBucket(org.redisson.RedissonBucket)

Example 3 with RedissonBucket

use of org.redisson.RedissonBucket in project redisson by redisson.

the class BucketCompareAndSetOperation method commit.

@Override
public void commit(CommandAsyncExecutor commandExecutor) {
    RedissonBucket<V> bucket = new RedissonBucket<V>(codec, commandExecutor, name);
    bucket.compareAndSetAsync(expected, value);
    RedissonLock lock = new RedissonTransactionalLock(commandExecutor, lockName, transactionId);
    lock.unlockAsync(getThreadId());
}
Also used : RedissonLock(org.redisson.RedissonLock) RedissonTransactionalLock(org.redisson.transaction.RedissonTransactionalLock) RedissonBucket(org.redisson.RedissonBucket)

Example 4 with RedissonBucket

use of org.redisson.RedissonBucket in project redisson by redisson.

the class BucketGetAndSetOperation method commit.

@Override
public void commit(CommandAsyncExecutor commandExecutor) {
    RBucket<V> bucket = new RedissonBucket<V>(codec, commandExecutor, name);
    if (timeToLive != 0) {
        bucket.getAndSetAsync((V) value, timeToLive, timeUnit);
    } else {
        bucket.getAndSetAsync((V) value);
    }
    RedissonLock lock = new RedissonTransactionalLock(commandExecutor, lockName, transactionId);
    lock.unlockAsync(getThreadId());
}
Also used : RedissonLock(org.redisson.RedissonLock) RedissonTransactionalLock(org.redisson.transaction.RedissonTransactionalLock) RedissonBucket(org.redisson.RedissonBucket)

Example 5 with RedissonBucket

use of org.redisson.RedissonBucket in project redisson by redisson.

the class BucketTrySetOperation method commit.

@Override
public void commit(CommandAsyncExecutor commandExecutor) {
    RedissonBucket<V> bucket = new RedissonBucket<V>(codec, commandExecutor, name);
    if (timeToLive != 0) {
        bucket.trySetAsync((V) value, timeToLive, timeUnit);
    } else {
        bucket.trySetAsync((V) value);
    }
    RedissonLock lock = new RedissonTransactionalLock(commandExecutor, lockName, transactionId);
    lock.unlockAsync(getThreadId());
}
Also used : RedissonLock(org.redisson.RedissonLock) RedissonTransactionalLock(org.redisson.transaction.RedissonTransactionalLock) RedissonBucket(org.redisson.RedissonBucket)

Aggregations

RedissonBucket (org.redisson.RedissonBucket)5 RedissonLock (org.redisson.RedissonLock)5 RedissonTransactionalLock (org.redisson.transaction.RedissonTransactionalLock)5