release branch 1.1.0

This commit is contained in:
binbin.hou
2022-12-08 11:15:03 +08:00
parent c45f6b53a0
commit 0bae77fc8a
22 changed files with 692 additions and 138 deletions

View File

@@ -1,17 +1,20 @@
package com.github.houbb.lock.test.core;
import com.github.houbb.id.core.core.Ids;
import com.github.houbb.lock.api.core.ILock;
import com.github.houbb.lock.core.bs.LockBs;
import com.github.houbb.lock.core.support.format.LockKeyFormat;
import com.github.houbb.lock.core.support.handler.LockReleaseFailHandler;
import com.github.houbb.lock.core.support.lock.RedisLockSupport;
import com.github.houbb.redis.config.core.factory.JedisRedisServiceFactory;
import org.junit.Test;
public class LockBsTest {
@Test
public void helloTest() {
ILock lock = LockBs.newInstance()
.init();
ILock lock = LockBs.newInstance();
String key = "ddd";
try {
// 加锁
@@ -25,4 +28,15 @@ public class LockBsTest {
}
}
@Test
public void configTest() {
LockBs.newInstance()
.id(Ids.uuid32()) //id 生成策略
.cache(JedisRedisServiceFactory.pooled("127.0.0.1", 6379)) //缓存策略
.lockSupport(new RedisLockSupport()) // 锁实现策略
.lockKeyFormat(new LockKeyFormat()) // 针对 key 的格式化处理策略
.lockReleaseFailHandler(new LockReleaseFailHandler()) //释放锁失败处理
;
}
}